X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Fgencgc.c;h=37b8b8ecc9467c7887572a2f96cb00ec4ba56587;hb=3106aee96a20d1a76a114e504bc2931f8196cace;hp=75ee8bbae24998dfe615700ffba539fd7e999282;hpb=1de12891f900d156ed035a097561ecd7755a256a;p=sbcl.git diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 75ee8bb..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; @@ -4410,7 +4408,7 @@ gc_init(void) /* Compute the number of pages needed for the dynamic space. * Dynamic space size should be aligned on page size. */ page_table_pages = dynamic_space_size/PAGE_BYTES; - gc_assert(dynamic_space_size == page_table_pages*PAGE_BYTES); + gc_assert(dynamic_space_size == (size_t) page_table_pages*PAGE_BYTES); page_table = calloc(page_table_pages, sizeof(struct page)); gc_assert(page_table); @@ -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); }