summaryrefslogtreecommitdiff
path: root/doc/ref/api-memory.texi
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-09-09 19:14:04 +0200
committerLudovic Courtès <ludo@gnu.org>2009-09-09 19:14:04 +0200
commitf07c349eb38d6c7b160b8980fc4007fb502e3433 (patch)
tree710496cd7cfc9ff47b5f7d6640c75e5014dbb20e /doc/ref/api-memory.texi
parent56273dea4bc44b798f6b661e4fca953437f512f7 (diff)
downloadguile-f07c349eb38d6c7b160b8980fc4007fb502e3433.tar.gz
Update doc of `scm_gc_protect_object ()' and SMOB mark/free.
* doc/ref/api-memory.texi (Garbage Collection Functions)[scm_gc_protect_object]: Explain that it's equivalent to storing in a global variable. * doc/ref/api-smobs.texi (Smobs)[scm_set_smob_free]: Expand on the relationship with `scm_gc_malloc ()'. [scm_set_smob_mark]: Explain that it's usually not needed.
Diffstat (limited to 'doc/ref/api-memory.texi')
-rw-r--r--doc/ref/api-memory.texi5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/ref/api-memory.texi b/doc/ref/api-memory.texi
index 48cce0c15..2bf7f10f7 100644
--- a/doc/ref/api-memory.texi
+++ b/doc/ref/api-memory.texi
@@ -41,6 +41,11 @@ otherwise might be. When you are done with the object, call
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.
+
+Note that storing @var{obj} in a C global variable has the same
+effect@footnote{In Guile up to version 1.8, C global variables were not
+scanned by the garbage collector; hence, @code{scm_gc_protect_object}
+was the only way in C to prevent a Scheme object from being freed.}.
@end deftypefn
@deftypefn {C Function} SCM scm_gc_unprotect_object (SCM @var{obj})