From 610a2a6511d06b65b23ce46ca468004202ce00fe 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 9304b395..11a00e07 100644 --- a/posixunix.scm +++ b/posixunix.scm @@ -1564,8 +1564,10 @@ EOF ##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) -- 2.11.0