mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-08 02:40:17 +02:00
Remove embedder requirement for per-object remset bits
Since we now have a field-logging write barrier, we don't need per-object log bits.
This commit is contained in:
parent
4be3e69ac1
commit
8e631ca3f3
5 changed files with 3 additions and 57 deletions
|
@ -102,32 +102,6 @@ static inline void gc_object_forward_nonatomic(struct gc_ref ref,
|
|||
*tag_word(ref) = gc_ref_value(new_ref);
|
||||
}
|
||||
|
||||
static inline int gc_object_set_remembered(struct gc_ref ref) {
|
||||
uintptr_t *loc = tag_word(ref);
|
||||
uintptr_t tag = atomic_load_explicit(loc, memory_order_relaxed);
|
||||
while (1) {
|
||||
if (tag & gcobj_remembered_bit)
|
||||
return 0;
|
||||
if (atomic_compare_exchange_weak_explicit(loc, &tag,
|
||||
tag | gcobj_remembered_bit,
|
||||
memory_order_acq_rel,
|
||||
memory_order_acquire))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int gc_object_is_remembered_nonatomic(struct gc_ref ref) {
|
||||
uintptr_t *loc = tag_word(ref);
|
||||
uintptr_t tag = *loc;
|
||||
return tag & gcobj_remembered_bit;
|
||||
}
|
||||
|
||||
static inline void gc_object_clear_remembered_nonatomic(struct gc_ref ref) {
|
||||
uintptr_t *loc = tag_word(ref);
|
||||
uintptr_t tag = *loc;
|
||||
*loc = tag & ~(uintptr_t)gcobj_remembered_bit;
|
||||
}
|
||||
|
||||
static inline struct gc_atomic_forward
|
||||
gc_atomic_forward_begin(struct gc_ref ref) {
|
||||
uintptr_t tag = atomic_load_explicit(tag_word(ref), memory_order_acquire);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue