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>2016-07-28 12:06:42 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-07-28 12:06:42 +0300
commit012da3f159076fadf828a023786c41aea8537fd4 (patch)
tree496238899e64a7ca747029a8ccfb9d95bd9a8ab8 /fnlz_mlc.c
parentb5d5c4363242461181b36f9fe565d9685c8bc6ad (diff)
Fix tag collision between ENABLE_DISCLAIM and KEEP_BACK_PTRS
* fnlz_mlc.c (FINALIZER_CLOSURE_FLAG): New macro (defined to 0x2 in case KEEP_BACK_PTRS or MAKE_BACK_GRAPH, otherwise to 0x1). * fnlz_mlc.c (GC_finalized_disclaim, GC_finalized_malloc): Use FINALIZER_CLOSURE_FLAG instead of 0x1.
Diffstat (limited to 'fnlz_mlc.c')
-rw-r--r--fnlz_mlc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fnlz_mlc.c b/fnlz_mlc.c
index 15b234b9..c6ba7aca 100644
--- a/fnlz_mlc.c
+++ b/fnlz_mlc.c
@@ -21,11 +21,18 @@
STATIC int GC_finalized_kind = 0;
+#if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
+ /* The first bit is already used for a debug purpose. */
+# define FINALIZER_CLOSURE_FLAG 0x2
+#else
+# define FINALIZER_CLOSURE_FLAG 0x1
+#endif
+
STATIC int GC_CALLBACK GC_finalized_disclaim(void *obj)
{
word fc_word = *(word *)obj;
- if ((fc_word & 1) != 0) {
+ if ((fc_word & FINALIZER_CLOSURE_FLAG) != 0) {
/* The disclaim function may be passed fragments from the */
/* free-list, on which it should not run finalization. */
/* To recognize this case, we use the fact that the first word */
@@ -34,7 +41,8 @@ STATIC int GC_CALLBACK GC_finalized_disclaim(void *obj)
/* which does not use the first word for storing finalization */
/* info, GC_reclaim_with_finalization must be extended to clear */
/* fragments so that the assumption holds for the selected word. */
- const struct GC_finalizer_closure *fc = (void *)(fc_word & ~(word)1);
+ const struct GC_finalizer_closure *fc
+ = (void *)(fc_word & ~(word)FINALIZER_CLOSURE_FLAG);
(*fc->proc)((word *)obj + 1, fc->cd);
}
return 0;
@@ -84,7 +92,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_finalized_malloc(size_t lb,
op = GC_malloc_kind(lb + sizeof(word), GC_finalized_kind);
if (EXPECT(NULL == op, FALSE))
return NULL;
- *op = (word)fclos | 1;
+ *op = (word)fclos | FINALIZER_CLOSURE_FLAG;
return op + 1;
}