summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-10 08:26:25 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-10 13:28:20 +0300
commite2b6b8d31a3ded95b1e76ef8eebd0350e2279f10 (patch)
treec33648195486f9a7f76d20e7181640828bd89033 /include
parentd4c4a7ba5e05ccff1ac9b9159d53c5975057d4a9 (diff)
downloadbdwgc-e2b6b8d31a3ded95b1e76ef8eebd0350e2279f10.tar.gz
Refine documentation of GC_register_disclaim_proc and GC_finalized_malloc
* include/gc/gc_disclaim.h (GC_register_disclaim_proc, GC_finalized_malloc): Refine comment.
Diffstat (limited to 'include')
-rw-r--r--include/gc/gc_disclaim.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/include/gc/gc_disclaim.h b/include/gc/gc_disclaim.h
index df5506de..7b434208 100644
--- a/include/gc/gc_disclaim.h
+++ b/include/gc/gc_disclaim.h
@@ -9,7 +9,6 @@
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
- *
*/
#ifndef GC_DISCLAIM_H
@@ -30,20 +29,21 @@
GC_API void GC_CALL GC_init_finalized_malloc(void);
/* Type of a disclaim call-back. Called with the allocation lock held. */
-typedef int (GC_CALLBACK * GC_disclaim_proc)(void * /*obj*/);
+typedef int (GC_CALLBACK * GC_disclaim_proc)(void * /* obj */);
-/* Register "proc" to be called on each object of "kind" ready to be */
-/* reclaimed. If "proc" returns non-zero, the collector will not */
-/* reclaim the object on this GC cycle ("proc" should not try to */
-/* resurrect the object otherwise). Objects reachable from "proc" */
+/* Register proc to be called on each object (of given kind) ready to */
+/* be reclaimed. If proc() returns non-zero, the collector will not */
+/* reclaim the object on this GC cycle (proc() should not try to */
+/* resurrect the object otherwise); objects reachable from proc() */
/* (including the referred closure object) will be protected from */
-/* collection if "mark_from_all" is non-zero, but at the expense that */
-/* long chains of objects will take many cycles to reclaim. */
-/* Calls to GC_free() will free its argument without inquiring "proc". */
-/* Acquires the allocation lock. No-op in the leak-finding mode. */
-GC_API void GC_CALL GC_register_disclaim_proc(int /*kind*/,
- GC_disclaim_proc /*proc*/,
- int /*mark_from_all*/);
+/* collection if mark_from_all is non-zero, but at the expense that */
+/* long chains of objects will take many cycles to reclaim. Any call */
+/* to GC_free() deallocates the object (pointed by the argument) */
+/* without inquiring proc(). Acquires the allocation lock. */
+/* No-op in the leak-finding mode. */
+GC_API void GC_CALL GC_register_disclaim_proc(int /* kind */,
+ GC_disclaim_proc /* proc */,
+ int /* mark_from_all */);
/* The finalizer closure used by GC_finalized_malloc. */
struct GC_finalizer_closure {
@@ -51,22 +51,22 @@ struct GC_finalizer_closure {
void *cd;
};
-/* Allocate "size" bytes which is finalized by "fc". This uses a */
-/* dedicated object kind with a disclaim procedure, and is more */
-/* efficient than GC_register_finalizer and friends. */
+/* Allocate an object which is to be finalized by the given closure. */
+/* This uses a dedicated object kind with a disclaim procedure, and is */
+/* more efficient than GC_register_finalizer and friends. */
/* GC_init_finalized_malloc must be called before using this. */
/* The collector will reclaim the object during this GC cycle (thus, */
-/* "proc" should not try to resurrect the object). The other objects */
-/* reachable from "proc" (including the closure object in case it is */
-/* a heap-allocated one) will be protected from collection. */
+/* fc->proc() should not try to resurrect the object). The other */
+/* objects reachable from fc->proc (including the closure object in */
+/* case it is a heap-allocated one) will be protected from collection. */
/* Note that GC_size (applied to such allocated object) returns a value */
/* slightly bigger than the specified allocation size, and that GC_base */
/* result points to a word prior to the start of the allocated object. */
/* The disclaim procedure is not invoked in the leak-finding mode. */
/* There is no debugging version of this allocation API. */
GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL
- GC_finalized_malloc(size_t /*size*/,
- const struct GC_finalizer_closure * /*fc*/) GC_ATTR_NONNULL(2);
+ GC_finalized_malloc(size_t /* size */,
+ const struct GC_finalizer_closure * /* fc */) GC_ATTR_NONNULL(2);
#ifdef __cplusplus
} /* extern "C" */