From 0f1033a0dc75c5c5f64e239daa38248936d69c5e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 18 Mar 2023 12:58:48 +0300 Subject: Better document link argument of GC_general_register_disappearing_link * include/gc/gc.h (GC_general_register_disappearing_link): Improve comment to outline that link could be in any memory. --- include/gc/gc.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/gc/gc.h b/include/gc/gc.h index c7640562..01d65b64 100644 --- a/include/gc/gc.h +++ b/include/gc/gc.h @@ -1276,12 +1276,13 @@ GC_API int GC_CALL GC_register_disappearing_link(void ** /* link */) GC_API int GC_CALL GC_general_register_disappearing_link(void ** /* link */, const void * /* obj */) GC_ATTR_NONNULL(1) GC_ATTR_NONNULL(2); - /* A slight generalization of the above. *link is */ + /* A slight generalization of the above. *link is */ /* cleared when obj first becomes inaccessible. This */ /* can be used to implement weak pointers easily and */ - /* safely. Typically link will point to a location */ - /* holding a disguised pointer to obj. (A pointer */ - /* inside an "atomic" object is effectively disguised.) */ + /* safely. Typically link will point to a location */ + /* (in a GC-allocated object or not) holding */ + /* a disguised pointer to obj. (A pointer inside */ + /* an "atomic" object is effectively disguised.) */ /* In this way, weak pointers are broken before any */ /* object reachable from them gets finalized. */ /* Each link may be registered only with one obj value, */ -- cgit v1.2.1