Skip to content

Commit

Permalink
suggestion from Gabriel's review
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto committed Jul 18, 2023
1 parent 3725a53 commit 509eb5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ FORCE_INLINE int gc_try_setmark_tag(jl_taggedvalue_t *o, uint8_t mark_mode) JL_N
tag = tag | mark_mode;
assert((tag & 0x3) == mark_mode);
}
// XXX: note that marking not only sets the GC bits but also updates the
// page metadata for pool allocated objects.
// The second step is **not** idempotent, so we need a compare exchange here
// (instead of a pair of load&store) to avoid marking an object twice
tag = jl_atomic_exchange_relaxed((_Atomic(uintptr_t)*)&o->header, tag);
verify_val(jl_valueof(o));
return !gc_marked(tag);
Expand Down

0 comments on commit 509eb5c

Please sign in to comment.