diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-11-29 11:46:48 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-11-29 13:45:47 +0300 |
commit | 9d8628c9f23d94124dd77f9e442b07e223f4a025 (patch) | |
tree | 81d7f0b9521555b1366cd8ed40f094c3a241731b /include/gc_disclaim.h | |
parent | fbf2630f952b961002e0023c47eb7d364418d044 (diff) | |
download | bdwgc-9d8628c9f23d94124dd77f9e442b07e223f4a025.tar.gz |
Fix GC_register_disclaim_proc for leak-finding mode
Issue #252 (bdwgc).
This makes the behavior of GC_register_disclaim_proc() and
GC_finalized_malloc() somewhat consistent with
GC_register_disappearing_link() and GC_register_finalizer() when
find-leak is on. The documentation is updated accordingly.
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_disclaim): Add assertion
that GC_find_leak is off.
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_register_disclaim_proc): Do not
assign ok_disclaim_proc, ok_mark_unconditionally fields if GC_find_leak.
* include/gc_disclaim.h (GC_register_disclaim_proc,
GC_finalized_malloc): Refine comment about leak-find mode and GC_free
invocation.
Diffstat (limited to 'include/gc_disclaim.h')
-rw-r--r-- | include/gc_disclaim.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/gc_disclaim.h b/include/gc_disclaim.h index 8123838e..f2942cdb 100644 --- a/include/gc_disclaim.h +++ b/include/gc_disclaim.h @@ -39,6 +39,8 @@ typedef int (GC_CALLBACK * GC_disclaim_proc)(void * /*obj*/); /* (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". */ +/* 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*/) GC_ATTR_NONNULL(2); @@ -60,6 +62,7 @@ struct GC_finalizer_closure { /* 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. */ 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); |