mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
* gc.c (scm_protect_object): Updated comment.
This commit is contained in:
parent
e0a7dd341d
commit
7bd4fbe2de
1 changed files with 12 additions and 8 deletions
|
@ -2127,15 +2127,19 @@ scm_permanent_object (SCM obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Protect OBJ from the garbage collector. OBJ will not be freed,
|
/* Protect OBJ from the garbage collector. OBJ will not be freed, even if all
|
||||||
even if all other references are dropped, until someone applies
|
other references are dropped, until the object is unprotected by calling
|
||||||
scm_unprotect_object to it. This function returns OBJ.
|
scm_unprotect_object (OBJ). Calls to scm_protect/unprotect_object nest,
|
||||||
|
i. e. it is possible to protect the same object several times, but it is
|
||||||
|
necessary to unprotect the object the same number of times to actually get
|
||||||
|
the object unprotected. It is an error to unprotect an object more often
|
||||||
|
than it has been protected before. The function scm_protect_object returns
|
||||||
|
OBJ.
|
||||||
|
*/
|
||||||
|
|
||||||
Calls to scm_protect_object nest. For every object OBJ, there is a
|
/* Implementation note: For every object X, there is a counter which
|
||||||
counter which scm_protect_object(OBJ) increments and
|
scm_protect_object(X) increments and scm_unprotect_object(X) decrements.
|
||||||
scm_unprotect_object(OBJ) decrements, if it is greater than zero. If
|
*/
|
||||||
an object's counter is greater than zero, the garbage collector
|
|
||||||
will not free it. */
|
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
scm_protect_object (SCM obj)
|
scm_protect_object (SCM obj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue