summaryrefslogtreecommitdiff
path: root/headers.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-08-04 09:28:42 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-08-04 09:28:42 +0300
commite717f1191ba099d46a4eb0c56954b1b2e5333d5b (patch)
tree9430219767f9534be57a7021ecfbdd7f7d1d7401 /headers.c
parent24b5f0ecc610d61c318c2c0afb594e41d4fbaf7d (diff)
downloadbdwgc-e717f1191ba099d46a4eb0c56954b1b2e5333d5b.tar.gz
Export GC_apply_to_all_blocks() as public API
Issue #460 (bdwgc). * headers.c (GC_apply_to_all_blocks): Add GC_API and GC_CALL modifiers; use GC_walk_hblk_fn; use GC_word instead of word; declare fn using GC_walk_hblk_fn; move comment to gc_mark.h. * include/gc/gc_mark.h (struct GC_hblk_s, GC_walk_hblk_fn): Declare. * include/gc/gc_mark.h (GC_apply_to_all_blocks): Move declaration from include/private/gc_priv.h. * include/private/gcconfig.h [GC_PRIVATE_H] (hblk): Define as macro (to GC_hblk_s).
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/headers.c b/headers.c
index 990ae7b0..b40fdfb8 100644
--- a/headers.c
+++ b/headers.c
@@ -329,11 +329,8 @@ GC_INNER void GC_remove_counts(struct hblk *h, size_t sz/* bytes */)
}
}
-/* Apply fn to all allocated blocks. It is the caller responsibility */
-/* to avoid data race during the function execution (e.g. by holding */
-/* the allocation lock). */
-void GC_apply_to_all_blocks(void (*fn)(struct hblk *h, word client_data),
- word client_data)
+GC_API void GC_CALL GC_apply_to_all_blocks(GC_walk_hblk_fn fn,
+ GC_word client_data)
{
signed_word j;
bottom_index * index_p;