1.0.0.26:
[sbcl.git] / src / runtime / gencgc.c
index bd48b12..37b8b8e 100644 (file)
@@ -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);
 }
 \f