Next: Weak References, Up: Memory Management
Scan all of SCM objects and reclaim for further use those that are no longer accessible.
Return an association list of statistics about Guile's current use of storage.
Protects obj from being freed by the garbage collector, when it otherwise might be. Since the garbage collector traverses the stack looking for scheme objects to mark, if you have create a scheme object from C code, and there are no references to it on the stack (because they are all on the heap), then the garbage collector might free that object even though it is still in use.
scm_protect_objectcauses the collector to mark the object whenever it runs. When you are done with the object, callscm_unprotect_objecton the object. Calls to scm_protect/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_unprotect_object. Returns the SCM object it was passed.
Similar to
scm_protect_objectin that it causes the collector to always mark the object, except that it should not be nested (only callscm_permanent_objecton 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.