aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@gcc.gnu.org>2006-06-20 17:10:19 +0000
committerRanjit Mathew <rmathew@gcc.gnu.org>2006-06-20 17:10:19 +0000
commit7227fd59811352001fd1a8bc88f4e99d8af065ec (patch)
treef5f09bc8de3372861139eacf0b8c5d60b274c132 /boehm-gc
parent261ea6e72e812dc32aa5af43e115be75dd44d8e7 (diff)
Backport Windows 9x/ME VirtualQuery() fix from GC 6.7.
* os_dep.c (GC_wnt): Define. (GC_init_win32): Set GC_wnt. * dyn_load.c (GC_register_dynamic_libraries): Consider MEM_PRIVATE sections also on Windows 9x/ME. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@114818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc')
-rw-r--r--boehm-gc/ChangeLog8
-rw-r--r--boehm-gc/dyn_load.c10
-rw-r--r--boehm-gc/os_dep.c5
3 files changed, 21 insertions, 2 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index cdb7f7c1d90..ca5f33ce613 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-20 Ranjit Mathew <rmathew@gcc.gnu.org>
+
+ Backport Windows 9x/ME VirtualQuery() fix from GC 6.7.
+ * os_dep.c (GC_wnt): Define.
+ (GC_init_win32): Set GC_wnt.
+ * dyn_load.c (GC_register_dynamic_libraries): Consider MEM_PRIVATE
+ sections also on Windows 9x/ME.
+
2006-06-02 Geoffrey Keating <geoffk@apple.com>
* configure.ac: Define HAS_PPC_THREAD_STATE_R0,
diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c
index 94e66092e31..3485474bee5 100644
--- a/boehm-gc/dyn_load.c
+++ b/boehm-gc/dyn_load.c
@@ -860,6 +860,9 @@ void GC_register_dynamic_libraries()
}
# endif /* DEBUG_VIRTUALQUERY */
+ extern GC_bool GC_wnt; /* Is Windows NT derivative. */
+ /* Defined and set in os_dep.c. */
+
void GC_register_dynamic_libraries()
{
MEMORY_BASIC_INFORMATION buf;
@@ -901,7 +904,12 @@ void GC_register_dynamic_libraries()
* !is_frame_buffer(p, buf.RegionSize, buf.Type)
* instead of just checking for MEM_IMAGE.
* If something breaks, change it back. */
- && buf.Type == MEM_IMAGE) {
+ /* 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)) {
# ifdef DEBUG_VIRTUALQUERY
GC_dump_meminfo(&buf);
# endif
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index fb50a4554b7..13692d9bcd6 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -1181,12 +1181,15 @@ void GC_register_data_segments()
/* This used to be set for gcc, to avoid dealing with */
/* the structured exception handling issues. But we now have */
/* assembly code to do that right. */
+ GC_bool GC_wnt = FALSE;
+ /* This is a Windows NT derivative, i.e. NT, W2K, XP or later. */
void GC_init_win32()
{
/* if we're running under win32s, assume that no DLLs will be loaded */
DWORD v = GetVersion();
- GC_no_win32_dlls |= ((v & 0x80000000) && (v & 0xff) <= 3);
+ GC_wnt = !(v & 0x80000000);
+ GC_no_win32_dlls |= ((!GC_wnt) && (v & 0xff) <= 3);
}
/* Return the smallest address a such that VirtualQuery */