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>2018-05-08 21:04:55 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-08 21:09:54 +0300
commit228bb2776633790c562fa7f2d31c60978331036a (patch)
tree9a63d139b6bdddf79494888f45596321a9569c06
parent9e6d6fdaa212f46fd6dc3b6e99a3ff0d99065a93 (diff)
Fix missing GC_dirty invocation from debug_end_stubborn_change
GC_debug_end_stubborn_change was no-op unless STUBBORN_ALLOC defined. * dbg_mlc.c (GC_debug_end_stubborn_change): De-duplicate definition; remove hhdr local variable. * dbg_mlc.c [!STUBBORN_ALLOC] (GC_debug_end_stubborn_change): Check p belongs to GC heap; call GC_end_stubborn_change(GC_base(p)).
-rw-r--r--dbg_mlc.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/dbg_mlc.c b/dbg_mlc.c
index 306ae94e..80b1bc9e 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -640,22 +640,6 @@ STATIC void * GC_debug_generic_malloc(size_t lb, int knd, GC_EXTRA_PARAMS)
GC_change_stubborn(q);
}
- GC_API void GC_CALL GC_debug_end_stubborn_change(const void *p)
- {
- const void * q = GC_base_C(p);
- hdr * hhdr;
-
- if (q == 0) {
- ABORT_ARG1("GC_debug_end_stubborn_change: bad arg", ": %p", p);
- }
- hhdr = HDR(q);
- if (hhdr -> hb_obj_kind != STUBBORN) {
- ABORT_ARG1("GC_debug_end_stubborn_change: arg not stubborn",
- ": %p", p);
- }
- GC_end_stubborn_change(q);
- }
-
#else /* !STUBBORN_ALLOC */
GC_API GC_ATTR_MALLOC void * GC_CALL GC_debug_malloc_stubborn(size_t lb,
@@ -666,11 +650,23 @@ STATIC void * GC_debug_generic_malloc(size_t lb, int knd, GC_EXTRA_PARAMS)
GC_API void GC_CALL GC_debug_change_stubborn(
const void * p GC_ATTR_UNUSED) {}
-
- GC_API void GC_CALL GC_debug_end_stubborn_change(
- const void * p GC_ATTR_UNUSED) {}
#endif /* !STUBBORN_ALLOC */
+GC_API void GC_CALL GC_debug_end_stubborn_change(const void *p)
+{
+ const void * q = GC_base_C(p);
+
+ if (NULL == q) {
+ ABORT_ARG1("GC_debug_end_stubborn_change: bad arg", ": %p", p);
+ }
+# ifdef STUBBORN_ALLOC
+ if (HDR(q) -> hb_obj_kind != STUBBORN)
+ ABORT_ARG1("GC_debug_end_stubborn_change: arg not stubborn",
+ ": %p", p);
+# endif
+ GC_end_stubborn_change(q);
+}
+
GC_API GC_ATTR_MALLOC void * GC_CALL GC_debug_malloc_atomic(size_t lb,
GC_EXTRA_PARAMS)
{