summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-09-26 12:15:21 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:48 +0200
commit0eedd22eaeb0e2042cc40c258c5e649ba3351aa9 (patch)
tree7086236a91a4878b60912e2a31dbefea5e698df7 /dyn_load.c
parent88d261763c5f05c3fa0a97e14f750c5be83a7b3d (diff)
2009-09-26 Ivan Maidanski <ivmai@mail.ru>
* 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.
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/dyn_load.c b/dyn_load.c
index f7c9360..84633c2 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