diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-05-16 08:34:10 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-05-16 12:34:33 +0400 |
commit | 5b25be3c7ac53699ca4fddf48c9d724b9575d7f8 (patch) | |
tree | 917df3fa7c7564bc0b5808c2eb763a6269d44206 /malloc.c | |
parent | 73cf1a5e9d15a5ba8fa947c286e265ead3b666bd (diff) |
Fix assertion in GC_malloc_[atomic_]uncollectable (THREADS case only)
* malloc.c (GC_malloc_uncollectable): Do not check assertion on
hb_n_marks to be zero if multi-threaded; add comment.
* mallocx.c (GC_malloc_atomic_uncollectable): Likewise.
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -322,7 +322,11 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb) /* mark bits. */ LOCK(); set_mark_bit_from_hdr(hhdr, 0); /* Only object. */ - GC_ASSERT(hhdr -> hb_n_marks == 0); +# ifndef THREADS + GC_ASSERT(hhdr -> hb_n_marks == 0); + /* This is not guaranteed in the multi-threaded case */ + /* because the counter could be updated before locking. */ +# endif hhdr -> hb_n_marks = 1; UNLOCK(); return((void *) op); |