Next: Memory Blocks, Up: Memory Management
Scans all of SCM objects and reclaims for further use those that are no longer accessible. You normally don't need to call this function explicitly. It is called automatically when appropriate.
Protects obj from being freed by the garbage collector, when it otherwise might be. When you are done with the object, call
scm_gc_unprotect_object
on the object. Calls toscm_gc_protect
/scm_gc_unprotect_object
can be nested, and the object remains protected until it has been unprotected as many times as it was protected. It is an error to unprotect an object more times than it has been protected. Returns the SCM object it was passed.
Unprotects an object from the garbage collector which was protected by
scm_gc_unprotect_object
. Returns the SCM object it was passed.
Similar to
scm_gc_protect_object
in that it causes the collector to always mark the object, except that it should not be nested (only callscm_permanent_object
on an object once), and it has no corresponding unpermanent function. Once an object is declared permanent, it will never be freed. Returns the SCM object it was passed.
Create a reference to the given object or objects, so they're certain to be present on the stack or in a register and hence will not be freed by the garbage collector before this point.
Note that these functions can only be applied to ordinary C local variables (ie. “automatics”). Objects held in global or static variables or some malloced block or the like cannot be protected with this mechanism.
Return an association list of statistics about Guile's current use of storage.