From b1eb4a6a978097c40338458b6b58856b397cb5e2 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Fri, 10 Nov 2017 21:38:04 +0100 Subject: [PATCH] Similar to 118fce and 596332, clean up old state upon fork When fork receives a thunk to run in the child process, call it with a clean, empty continuation rather than keeping any cruft from the parent around. This should allow GC of objects that are no longer necessary and improve memory use somewhat, and perhaps prevent situations like that in #1367 when using processes instead of threads. --- posixunix.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posixunix.scm b/posixunix.scm index 5ac48082..0e22c28e 100644 --- a/posixunix.scm +++ b/posixunix.scm @@ -1294,8 +1294,10 @@ static C_word C_i_fifo_p(C_word name) ##sys#kill-other-threads (lambda (thunk) (thunk))) (lambda () - (thunk) - (exit 0))) + (##sys#call-with-cthulhu + (lambda () + (thunk) + (exit 0))))) pid))))) (define (process-execute filename #!optional (arglist '()) envlist exactf) -- 2.11.0