X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgencgc.c;h=37b8b8ecc9467c7887572a2f96cb00ec4ba56587;hb=3106aee96a20d1a76a114e504bc2931f8196cace;hp=bd48b12adc029c52b170af1740c91ad96cd7e895;hpb=afb952a15b893beccbc7750ebdc0ee403459fe28;p=sbcl.git diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index bd48b12..37b8b8e 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -148,8 +148,6 @@ unsigned long bytes_allocated = 0; extern unsigned long bytes_consed_between_gcs; /* gc-common.c */ unsigned long auto_gc_trigger = 0; -size_t dynamic_space_size = DEFAULT_DYNAMIC_SPACE_SIZE; - /* the source and destination generations. These are set before a GC starts * scavenging. */ generation_index_t from_space; @@ -4546,8 +4544,12 @@ alloc(long nbytes) #else &boxed_region; #endif +#ifndef LISP_FEATURE_WIN32 + lispobj alloc_signal; +#endif void *new_obj; void *new_free_pointer; + gc_assert(nbytes>0); /* Check for alignment allocation problems. */ @@ -4599,6 +4601,24 @@ alloc(long nbytes) } } new_obj = gc_alloc_with_region(nbytes,0,region,0); + +#ifndef LISP_FEATURE_WIN32 + alloc_signal = SymbolValue(ALLOC_SIGNAL,thread); + if ((alloc_signal & FIXNUM_TAG_MASK) == 0) { + if ((signed long) alloc_signal <= 0) { +#ifdef LISP_FEATURE_SB_THREAD + kill_thread_safely(thread->os_thread, SIGPROF); +#else + raise(SIGPROF); +#endif + } else { + SetSymbolValue(ALLOC_SIGNAL, + alloc_signal - (1 << N_FIXNUM_TAG_BITS), + thread); + } + } +#endif + return (new_obj); }