* dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls.
* misc.c: Renamed GC_is_win32s() to GC_no_win32_dlls
* os_dep.c: Renamed GC_win32s to GC_no_win32_dlls and
statically initialized it to TRUE if compiling with GCC.
* win32_threads.c (thread_start): We no longer use SEH if
compiling with GCC.
* mark.c (GC_mark_some): We no longer use SEH if
compiling with GCC.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50671
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-03-12 Adam Megacz <adam@xwt.org>
+
+ * dyn_load.c: Renamed GC_win32s to GC_no_win32_dlls.
+ * misc.c: Renamed GC_is_win32s() to GC_no_win32_dlls
+ * os_dep.c: Renamed GC_win32s to GC_no_win32_dlls and
+ statically initialized it to TRUE if compiling with GCC.
+ * win32_threads.c (thread_start): We no longer use SEH if
+ compiling with GCC.
+ * mark.c (GC_mark_some): We no longer use SEH if
+ compiling with GCC.
+
2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ
# endif
# ifndef MSWINCE
- extern GC_bool GC_win32s;
+ extern GC_bool GC_no_win32_dlls;
# endif
void GC_register_dynamic_libraries()
char * limit, * new_limit;
# ifdef MSWIN32
- if (GC_win32s) return;
+ if (GC_no_win32_dlls) return;
# endif
base = limit = p = GC_sysinfo.lpMinimumApplicationAddress;
# if defined(MSWINCE) && !defined(_WIN32_WCE_EMULATION)
GC_bool GC_mark_some(cold_gc_frame)
ptr_t cold_gc_frame;
{
-#ifdef MSWIN32
+#if defined(MSWIN32) && !defined(__GNUC__)
/* Windows 98 appears to asynchronously create and remove writable */
/* memory mappings, for reasons we haven't yet understood. Since */
/* we look for writable regions to determine the root set, we may */
/* Note that this code should never generate an incremental GC write */
/* fault. */
__try {
-#endif
+#endif /* defined(MSWIN32) && !defined(__GNUC__) */
switch(GC_mark_state) {
case MS_NONE:
return(FALSE);
ABORT("GC_mark_some: bad state");
return(FALSE);
}
-#ifdef MSWIN32
+#if defined(MSWIN32) && !defined(__GNUC__)
} __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
# ifdef CONDPRINT
scan_ptr = 0;
return FALSE;
}
-#endif /* MSWIN32 */
+#endif /* defined(MSWIN32) && !defined(__GNUC__) */
}
#endif
#ifdef MSWIN32
- extern GC_bool GC_is_win32s();
+extern GC_bool GC_no_win32_dlls;
#else
-# define GC_is_win32s() FALSE
+# define GC_no_win32_dlls FALSE
#endif
void GC_init_inner()
GC_pcr_install();
# endif
# if !defined(SMALL_CONFIG)
- if (!GC_is_win32s() && 0 != GETENV("GC_ENABLE_INCREMENTAL")) {
+ if (!GC_no_win32_dlls && 0 != GETENV("GC_ENABLE_INCREMENTAL")) {
GC_ASSERT(!GC_incremental);
GC_setpagesize();
# ifndef GC_SOLARIS_THREADS
LOCK();
if (GC_incremental) goto out;
GC_setpagesize();
- if (GC_is_win32s()) goto out;
+ if (GC_no_win32_dlls) goto out;
# ifndef GC_SOLARIS_THREADS
GC_dirty_init();
# endif
/* all real work is done by GC_register_dynamic_libraries. Under */
/* win32s, we cannot find the data segments associated with dll's. */
/* We rgister the main data segment here. */
- GC_bool GC_win32s = FALSE; /* We're running under win32s. */
-
- GC_bool GC_is_win32s()
- {
- DWORD v = GetVersion();
-
- /* Check that this is not NT, and Windows major version <= 3 */
- return ((v & 0x80000000) && (v & 0xff) <= 3);
- }
+# ifdef __GCC__
+ GC_bool GC_no_win32_dlls = TRUE; /* GCC can't do SEH, so we can't use VirtualQuery */
+# else
+ GC_bool GC_no_win32_dlls = FALSE;
+# endif
void GC_init_win32()
{
- GC_win32s = GC_is_win32s();
+ /* 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);
}
/* Return the smallest address a such that VirtualQuery */
char * base;
char * limit, * new_limit;
- if (!GC_win32s) return;
+ if (!GC_no_win32_dlls) return;
p = base = limit = GC_least_described_address(static_root);
while (p < GC_sysinfo.lpMaximumApplicationAddress) {
result = VirtualQuery(p, &buf, sizeof(buf));
# ifdef USE_GLOBAL_ALLOC
# define GLOBAL_ALLOC_TEST 1
# else
-# define GLOBAL_ALLOC_TEST GC_win32s
+# define GLOBAL_ALLOC_TEST GC_no_win32_dlls
# endif
word GC_n_heap_bases = 0;
void GC_win32_free_heap ()
{
- if (GC_win32s) {
+ if (GC_no_win32_dlls) {
while (GC_n_heap_bases > 0) {
GlobalFree (GC_heap_bases[--GC_n_heap_bases]);
GC_heap_bases[GC_n_heap_bases] = 0;
/* Clear the thread entry even if we exit with an exception. */
/* This is probably pointless, since an uncaught exception is */
/* supposed to result in the process being killed. */
+#ifndef __GNUC__
__try {
+#endif /* __GNUC__ */
ret = args.start (args.param);
+#ifndef __GNUC__
} __finally {
+#endif /* __GNUC__ */
LOCK();
args.entry->stack = 0;
args.entry->in_use = FALSE;
/* cast away volatile qualifier */
BZERO((void *) &args.entry->context, sizeof(CONTEXT));
UNLOCK();
+#ifndef __GNUC__
}
+#endif /* __GNUC__ */
return ret;
}