From: Tim Vaughan Date: Tue, 31 Oct 2017 20:44:39 +0000 (+0100) Subject: Merge branch 'master' into call-cc X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=scheme.forth.jl.git;a=commitdiff_plain;h=f71c5f93aefa930fd0ac175416523bc6a101e3df Merge branch 'master' into call-cc --- f71c5f93aefa930fd0ac175416523bc6a101e3df diff --cc src/scheme.4th index e94796c,2a509e6..93d2496 --- a/src/scheme.4th +++ b/src/scheme.4th @@@ -2006,6 -1939,29 +2000,21 @@@ parse-idx-stack parse-idx-sp \ ---- Garbage Collection ---- {{{ + ( Notes on garbage collection: + This is a mark-sweep garbage collector, invoked by cons. + The roots of the object tree used by the marking routine + include all objects in the parameter stack, and several + other fixed roots such as global-env, symbol-table, macro-table, + and the console-i/o-port. + + NO OTHER OBJECTS WILL BE MARKED! + + This places implicit restrictions on when cons can be invoked. + Invoking cons when live objects are stored on the return stack + or in other variables than the above will result in possible + memory corruption if the cons triggers the GC. ) + -variable gc-stack-depth - -: enable-gc - depth gc-stack-depth ! - true gc-enabled ! ; - -: disable-gc - false gc-enabled ! ; + : pairlike? ( obj -- obj bool ) pair-type istype? if true exit then string-type istype? if true exit then