summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-10-01 14:48:38 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:49 +0200
commit733b99815b7d586d551151934d24551c4c034400 (patch)
tree6492116f09a49a343150169ed65e589730baad48 /dyn_load.c
parentd07f685fb7d89fd1b09a620ffccc22f7c838d517 (diff)
2009-10-01 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (GC_register_dynamic_libraries): Always use lpMaximumApplicationAddress value for WinCE (even for old versions). * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h. * os_dep.c (GC_dont_query_stack_min): New global variable (only if WinCE and THREADS). * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set GC_dont_query_stack_min for older WinCE (prior to version 5). * win32_threads.c (GC_dont_query_stack_min): Declare. * win32_threads.c (GC_get_stack_min): Rename the macro to GC_wince_evaluate_stack_min for WinCE; update the comment. * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for WinCE and don't update thread's last_stack_min value (only if GC_dont_query_stack_min). * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if GC_dont_query_stack_min (since the evaluated stack_min value may be incorrect if the stack is bigger than 64 KiB).
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/dyn_load.c b/dyn_load.c
index 1679ebc..8539172 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -884,22 +884,17 @@ void GC_register_dynamic_libraries(void)
if (GC_no_win32_dlls) return;
# endif
base = limit = p = GC_sysinfo.lpMinimumApplicationAddress;
- /* Note: -D_WIN32_WCE_EMULATION seems to be required for WinCE 6. */
-# if defined(MSWINCE) && !defined(_WIN32_WCE_EMULATION)
- /* Only the first 32 MB of address space belongs to the current process */
- while (p < (LPVOID)0x02000000) {
+ while (p < GC_sysinfo.lpMaximumApplicationAddress) {
result = VirtualQuery(p, &buf, sizeof(buf));
- if (result == 0) {
+# ifdef MSWINCE
+ if (result == 0) {
/* Page is free; advance to the next possible allocation base */
new_limit = (char *)
(((DWORD) p + GC_sysinfo.dwAllocationGranularity)
& ~(GC_sysinfo.dwAllocationGranularity-1));
- } else
-# else
- while (p < GC_sysinfo.lpMaximumApplicationAddress) {
- result = VirtualQuery(p, &buf, sizeof(buf));
-# endif
- {
+ } else
+# endif
+ /* else */ {
if (result != sizeof(buf)) {
ABORT("Weird VirtualQuery result");
}