summaryrefslogtreecommitdiff
path: root/boehm-gc/mark.c
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-10 21:59:16 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-10 21:59:16 +0000
commit7408c700e57ebc650275d0c6b7429aabe76fbddb (patch)
treeacd5ad4441f2b173be71279a47ebb3ad91ab054b /boehm-gc/mark.c
parentb25ceadc0b851a64cc6fcfd2cc305867ca5fb3e8 (diff)
downloadgcc-7408c700e57ebc650275d0c6b7429aabe76fbddb.tar.gz
2000-05-11 Bryce McKinlay <bryce@albatross.co.nz>
Imported 5.0 release version. * acinclude.m4: Increment version to 5.0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33832 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/mark.c')
-rw-r--r--boehm-gc/mark.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/boehm-gc/mark.c b/boehm-gc/mark.c
index d77e6acd8da..461d9897957 100644
--- a/boehm-gc/mark.c
+++ b/boehm-gc/mark.c
@@ -252,6 +252,17 @@ static void alloc_mark_stack();
GC_bool GC_mark_some(cold_gc_frame)
ptr_t cold_gc_frame;
{
+#ifdef MSWIN32
+ /* 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 */
+ /* try to mark from an address range that disappeared since we */
+ /* started the collection. Thus we have to recover from faults here. */
+ /* This code does not appear to be necessary for Windows 95/NT/2000. */
+ /* Note that this code should never generate an incremental GC write */
+ /* fault. */
+ __try {
+#endif
switch(GC_mark_state) {
case MS_NONE:
return(FALSE);
@@ -342,6 +353,20 @@ ptr_t cold_gc_frame;
ABORT("GC_mark_some: bad state");
return(FALSE);
}
+#ifdef MSWIN32
+ } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
+ EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
+# ifdef PRINTSTATS
+ GC_printf0("Caught ACCESS_VIOLATION in marker. "
+ "Memory mapping disappeared.\n");
+# endif /* PRINTSTATS */
+ /* We have bad roots on the stack. Discard mark stack. */
+ /* Rescan from marked objects. Redetermine roots. */
+ GC_invalidate_mark_state();
+ scan_ptr = 0;
+ return FALSE;
+ }
+#endif /* MSWIN32 */
}