Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-05-16 08:34:10 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-05-16 12:34:33 +0400
commit5b25be3c7ac53699ca4fddf48c9d724b9575d7f8 (patch)
tree917df3fa7c7564bc0b5808c2eb763a6269d44206 /malloc.c
parent73cf1a5e9d15a5ba8fa947c286e265ead3b666bd (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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/malloc.c b/malloc.c
index 0fc28fd1..8e5552f8 100644
--- a/malloc.c
+++ b/malloc.c
@@ -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);