collect a little in call-with-new-thread
authorAndy Wingo <wingo@pobox.com>
Tue, 29 Nov 2011 19:26:40 +0000 (20:26 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 29 Nov 2011 19:26:40 +0000 (20:26 +0100)
* libguile/threads.c (scm_call_with_new_thread): Collect a little before
  making a new thread.  Our adjust_gc_frequency hack doesn't work well
  if the main allocation load is thread creation, as in
  https://savannah.gnu.org/bugs/?34140.  This does not appreciably
  affect the speed of the test in that bug, but does effectively limit
  the image size.

libguile/threads.c

index e4d3e21..f71c83c 100644 (file)
@@ -1006,6 +1006,7 @@ SCM_DEFINE (scm_call_with_new_thread, "call-with-new-thread", 1, 1, 0,
   SCM_ASSERT (SCM_UNBNDP (handler) || scm_is_true (scm_procedure_p (handler)),
              handler, SCM_ARG2, FUNC_NAME);
 
+  GC_collect_a_little ();
   data.parent = scm_current_dynamic_state ();
   data.thunk = thunk;
   data.handler = handler;