[CM] Protecting Scheme data structures from GC?

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Sat Apr 29 10:13:58 PDT 2023


To keep an environment from the being garbage collected,
assign it to a global variable -- as long as the variable
holds the environment, it will be safe.  This won't speed
up the GC.  It's possible to make s7 strings that are not
seen at all by the GC (make_permament_string), but it's much
trickier for an environment -- you'd have to be sure that
every cell of every variable in the environment was
permanent; otherwise the cell might have no one else
referring to it, and the GC would free it.



More information about the Cmdist mailing list