X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fcheneygc.c;h=cf79fc3aa7ec3ed1ba62aa443182e7134ea8af0e;hb=743831e679b673a5680a0afd8402911516bf50e2;hp=2ba625077e16a06eeadc7ed1a8f878615970ee5f;hpb=95dadf0341e9a47b448ab30f51c33c60c451a207;p=sbcl.git diff --git a/src/runtime/cheneygc.c b/src/runtime/cheneygc.c index 2ba6250..cf79fc3 100644 --- a/src/runtime/cheneygc.c +++ b/src/runtime/cheneygc.c @@ -61,31 +61,6 @@ tv_diff(struct timeval *x, struct timeval *y) } #endif -#define BYTES_ZERO_BEFORE_END (1<<12) - -/* FIXME do we need this? Doesn't it duplicate lisp code in - * scrub-control-stack? */ - -static void -zero_stack(void) -{ - lispobj *ptr = current_control_stack_pointer; - search: - do { - if (*ptr) - goto fill; - ptr++; - } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); - return; - fill: - do { - *ptr++ = 0; - } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); - - goto search; -} - - void * gc_general_alloc(long bytes, int page_type_flag, int quick_p) { lispobj *new=new_space_free_pointer; @@ -132,9 +107,7 @@ collect_garbage(generation_index_t ignore) /* it's possible that signals are blocked already if this was called * from a signal handler (e.g. with the sigsegv gc_trigger stuff) */ - sigemptyset(&tmp); - sigaddset_blockable(&tmp); - thread_sigmask(SIG_BLOCK, &tmp, &old); + block_blockable_signals(0, &old); current_static_space_free_pointer = (lispobj *) ((unsigned long) @@ -260,7 +233,7 @@ collect_garbage(generation_index_t ignore) #ifdef PRINTNOISE printf("Zeroing empty part of control stack ...\n"); #endif - zero_stack(); + scrub_control_stack(); set_auto_gc_trigger(size_retained+bytes_consed_between_gcs); thread_sigmask(SIG_SETMASK, &old, 0); @@ -654,6 +627,8 @@ cheneygc_handle_wp_violation(os_context_t *context, void *addr) * the PA section */ SetSymbolValue(GC_PENDING,T,thread); arch_set_pseudo_atomic_interrupted(context); + maybe_save_gc_mask_and_block_deferrables + (os_context_sigmask_addr(context)); } else { maybe_gc(context); }