From 0eedd22eaeb0e2042cc40c258c5e649ba3351aa9 Mon Sep 17 00:00:00 2001 From: ivmai Date: Sat, 26 Sep 2009 10:15:21 +0000 Subject: [PATCH] 2009-09-26 Ivan Maidanski * dyn_load.c (GC_wnt): Update the comment. * dyn_load.c (GC_register_dynamic_libraries): Add the comment for _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new macro); call GC_is_heap_base() only if check for Type succeeded. --- ChangeLog | 7 +++++++ dyn_load.c | 21 ++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5191235..75aa0958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-26 Ivan Maidanski + + * dyn_load.c (GC_wnt): Update the comment. + * dyn_load.c (GC_register_dynamic_libraries): Add the comment for + _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new + macro); call GC_is_heap_base() only if check for Type succeeded. + 2009-09-26 Ivan Maidanski * mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING; diff --git a/dyn_load.c b/dyn_load.c index f7c93601..84633c28 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -865,6 +865,7 @@ void GC_register_dynamic_libraries(void) /* WinCE because otherwise SEGV fault sometimes happens to occur in */ /* GC_mark_from() (and, even if we use WRAP_MARK_SOME, WinCE prints */ /* a "Data Abort" message to the debugging console). */ + /* To workaround that, use -DGC_REGISTER_MEM_PRIVATE. */ # define GC_wnt TRUE # else extern GC_bool GC_wnt; /* Is Windows NT derivative. */ @@ -884,6 +885,7 @@ 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) { @@ -907,13 +909,18 @@ void GC_register_dynamic_libraries(void) if (buf.State == MEM_COMMIT && (protect == PAGE_EXECUTE_READWRITE || protect == PAGE_READWRITE) - && !GC_is_heap_base(buf.AllocationBase) - /* There is some evidence that we cannot always - * ignore MEM_PRIVATE sections under Windows ME - * and predecessors. Hence we now also check for - * that case. */ - && (buf.Type == MEM_IMAGE || - (!GC_wnt && buf.Type == MEM_PRIVATE))) { + && (buf.Type == MEM_IMAGE +# ifdef GC_REGISTER_MEM_PRIVATE + || (protect == PAGE_READWRITE && buf.Type == MEM_PRIVATE) +# else + /* There is some evidence that we cannot always */ + /* ignore MEM_PRIVATE sections under Windows ME */ + /* and predecessors. Hence we now also check for */ + /* that case. */ + || (!GC_wnt && buf.Type == MEM_PRIVATE) +# endif + ) + && !GC_is_heap_base(buf.AllocationBase)) { # ifdef DEBUG_VIRTUALQUERY GC_dump_meminfo(&buf); # endif -- 2.40.0