summaryrefslogtreecommitdiff
path: root/headers.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-04-10 11:28:09 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-04-10 11:28:09 +0300
commit0248b068ec9f3adfafa55095c20d552d2d9e79d4 (patch)
treedf9db1de66dcdee6038390d15e4b00afbb95a547 /headers.c
parentd7ea0b1082b85c1c868864357db015668240bdf1 (diff)
downloadbdwgc-0248b068ec9f3adfafa55095c20d552d2d9e79d4.tar.gz
Remove assertion about held lock from apply_to_all_blocks
(fix of commit 5e6cc59b0) GC_apply_to_all_blocks may be called by GC_print_block_list which, in turn, might be called from the debugger not holding the lock. * headers.c (GC_apply_to_all_blocks): Add comment about the lock; remove VARARGS1 in comment; remove explicit assertion that the lock is held.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/headers.c b/headers.c
index 4236ceca..d2c283c5 100644
--- a/headers.c
+++ b/headers.c
@@ -313,15 +313,15 @@ GC_INNER void GC_remove_counts(struct hblk *h, size_t sz/* bytes */)
}
}
-/* Apply fn to all allocated blocks */
-/*VARARGS1*/
+/* 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)
{
signed_word j;
bottom_index * index_p;
- GC_ASSERT(I_HOLD_LOCK());
for (index_p = GC_all_bottom_indices; index_p != 0;
index_p = index_p -> asc_link) {
for (j = BOTTOM_SZ-1; j >= 0;) {