diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-01-31 20:15:54 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-03-14 11:35:30 +0300 |
commit | 696f7970c0557c0a16169fc85841bd3829a69b4b (patch) | |
tree | 971febe6e8764027e1f224209e8af19c6911d464 | |
parent | 71ff4a4193a58e2a1f8f3a71ab5001e7f5aff458 (diff) | |
download | bdwgc-696f7970c0557c0a16169fc85841bd3829a69b4b.tar.gz |
Fix store-and-dirty call in GC_CONS
(a cherry-pick of commit f6befb64d from 'master')
GC_PTR_STORE_AND_DIRTY() might be expanded to a debugging version of
the store-and-dirty function, thus the former should not be used for
pointers returned from the non-debugging version of a GC allocation
routine like GC_FAST_MALLOC_GRANS().
* include/gc_inline.h: Add comment that the debugging version of
this API is missing.
* include/gc_inline.h (GC_CONS): Use GC_ptr_store_and_dirty()
instead of GC_PTR_STORE_AND_DIRTY().
-rw-r--r-- | include/gc_inline.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/gc_inline.h b/include/gc_inline.h index 78a714a4..1b0c4c70 100644 --- a/include/gc_inline.h +++ b/include/gc_inline.h @@ -27,6 +27,7 @@ /* This interface is most useful for compilers that generate C. */ /* It is also used internally for thread-local allocation. */ /* Manual use is hereby discouraged. */ +/* There is no debugging version of this allocation API. */ #include "gc.h" #include "gc_tiny_fl.h" @@ -194,7 +195,7 @@ GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL GC_MALLOC_WORDS_KIND(result, 2, tiny_fl, GC_I_NORMAL, (void)0); \ if ((result) != 0 /* NULL */) { \ *(void **)(result) = l; \ - GC_PTR_STORE_AND_DIRTY((void **)(result) + 1, r); \ + GC_ptr_store_and_dirty((void **)(result) + 1, r); \ GC_reachable_here(l); \ } \ } while (0) |