1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

collect a little in call-with-new-thread

* 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.
This commit is contained in:
Andy Wingo 2011-11-29 20:26:40 +01:00
parent 7a4eb5e5ec
commit 9f7537dcab

View 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)), SCM_ASSERT (SCM_UNBNDP (handler) || scm_is_true (scm_procedure_p (handler)),
handler, SCM_ARG2, FUNC_NAME); handler, SCM_ARG2, FUNC_NAME);
GC_collect_a_little ();
data.parent = scm_current_dynamic_state (); data.parent = scm_current_dynamic_state ();
data.thunk = thunk; data.thunk = thunk;
data.handler = handler; data.handler = handler;