X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterrupt.c;h=f191cd38db3b6f37112225411c2bb3925fa291f6;hb=df679ed627975948b1cee190f4d79c397588c43e;hp=5155c6a4fde116feab6efa5dbc489b6c82f48fbc;hpb=02c9007b4ca5753406f60019f4fe5e5f8392541a;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 5155c6a..f191cd3 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -562,11 +562,13 @@ boolean handle_control_stack_guard_triggered(os_context_t *context,void *addr) else return 0; } -#ifndef LISP_FEATURE_X86 +#ifndef LISP_FEATURE_GENCGC /* This function gets called from the SIGSEGV (for e.g. Linux or * OpenBSD) or SIGBUS (for e.g. FreeBSD) handler. Here we check * whether the signal was due to treading on the mprotect()ed zone - * and if so, arrange for a GC to happen. */ +extern unsigned long bytes_consed_between_gcs; /* gc-common.c */ + boolean interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) { @@ -575,16 +577,8 @@ interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) struct interrupt_data *data= th ? th->interrupt_data : global_interrupt_data; - if (!foreign_function_call_active -#ifndef LISP_FEATURE_GENCGC - /* nb: GENCGC on non-x86? I really don't think so. This - * happens every time */ - && gc_trigger_hit(signal, info, context) -#endif - ) { -#ifndef LISP_FEATURE_GENCGC + if(!foreign_function_call_active && gc_trigger_hit(signal, info, context)){ clear_auto_gc_trigger(); -#endif if (arch_pseudo_atomic_atomic(context)) { /* don't GC during an atomic operation. Instead, copy the @@ -604,18 +598,13 @@ interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) arch_set_pseudo_atomic_interrupted(context); } else { - lispobj *old_free_space=current_dynamic_space; fake_foreign_function_call(context); + /* SUB-GC may return without GCing if *GC-INHIBIT* is set, + * in which case we will be running with no gc trigger + * barrier thing for a while. But it shouldn't be long + * until the end of WITHOUT-GCING. */ funcall0(SymbolFunction(SUB_GC)); undo_fake_foreign_function_call(context); - if(current_dynamic_space==old_free_space) - /* MAYBE-GC (as the name suggest) might not. If it - * doesn't, it won't reset the GC trigger either, so we - * have to do it ourselves. Put it near the end of - * dynamic space so we're not running into it continually - */ - set_auto_gc_trigger(DYNAMIC_SPACE_SIZE - -(u32)os_vm_page_size); } return 1; } else { @@ -674,7 +663,7 @@ undoably_install_low_level_interrupt_handler (int signal, if(signal==SIG_MEMORY_FAULT) sa.sa_flags|= SA_ONSTACK; #endif - sigaction(signal, &sa, NULL); + sigaction(signal, &sa, NULL); data->interrupt_low_level_handlers[signal] = (ARE_SAME_HANDLER(handler, SIG_DFL) ? 0 : handler); }