X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgencgc.c;h=33534258fb4ee59937966081285c0f008fd38def;hb=619189958917e80786d5bb2efa4dc38d908d2553;hp=895ced22db3784764c7dcb6523d348204e266a8b;hpb=de0a47a2f2b165f34177669bd9499135847b4897;p=sbcl.git diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 895ced2..3353425 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -1172,7 +1172,9 @@ gc_heap_exhausted_error_or_lose (long available, long requested) fprintf(stderr, "GC control variables:\n"); fprintf(stderr, " *GC-INHIBIT* = %s\n *GC-PENDING* = %s\n", SymbolValue(GC_INHIBIT,thread)==NIL ? "false" : "true", - SymbolValue(GC_PENDING,thread)==NIL ? "false" : "true"); + (SymbolValue(GC_PENDING, thread) == T) ? + "true" : ((SymbolValue(GC_PENDING, thread) == NIL) ? + "false" : "in progress")); #ifdef LISP_FEATURE_SB_THREAD fprintf(stderr, " *STOP-FOR-GC-PENDING* = %s\n", SymbolValue(STOP_FOR_GC_PENDING,thread)==NIL ? "false" : "true"); @@ -4721,8 +4723,17 @@ general_alloc_internal(long nbytes, int page_type_flag, struct alloc_region *reg /* set things up so that GC happens when we finish the PA * section */ SetSymbolValue(GC_PENDING,T,thread); - if (SymbolValue(GC_INHIBIT,thread) == NIL) - set_pseudo_atomic_interrupted(thread); + if (SymbolValue(GC_INHIBIT,thread) == NIL) { + set_pseudo_atomic_interrupted(thread); +#ifdef LISP_FEATURE_PPC + /* PPC calls alloc() from a trap, look up the most + * recent one and frob that. */ + maybe_save_gc_mask_and_block_deferrables + (get_interrupt_context_for_thread(thread)); +#else + maybe_save_gc_mask_and_block_deferrables(NULL); +#endif + } } } new_obj = gc_alloc_with_region(nbytes, page_type_flag, region, 0); @@ -4732,7 +4743,7 @@ general_alloc_internal(long nbytes, int page_type_flag, struct alloc_region *reg if ((alloc_signal & FIXNUM_TAG_MASK) == 0) { if ((signed long) alloc_signal <= 0) { SetSymbolValue(ALLOC_SIGNAL, T, thread); - thread_kill(thread->os_thread, SIGPROF); + raise(SIGPROF); } else { SetSymbolValue(ALLOC_SIGNAL, alloc_signal - (1 << N_FIXNUM_TAG_BITS), @@ -4813,6 +4824,9 @@ gencgc_handle_wp_violation(void* fault_addr) return 0; } else { + int ret; + ret = thread_mutex_lock(&free_pages_lock); + gc_assert(ret == 0); if (page_table[page_index].write_protected) { /* Unprotect the page. */ os_protect(page_address(page_index), PAGE_BYTES, OS_VM_PROT_ALL); @@ -4830,6 +4844,8 @@ gencgc_handle_wp_violation(void* fault_addr) page_index, boxed_region.first_page, boxed_region.last_page); } + ret = thread_mutex_unlock(&free_pages_lock); + gc_assert(ret == 0); /* Don't worry, we can handle it. */ return 1; }