mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-05 17:20:18 +02:00
nofl: Assert no forwarded object after GC in debug mode
This commit is contained in:
parent
e098e55a8c
commit
162c5364b3
1 changed files with 13 additions and 2 deletions
|
@ -1374,6 +1374,13 @@ nofl_metadata_byte_trace_kind(struct nofl_space *space, uint8_t byte)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nofl_assert_not_forwarded(struct gc_ref ref)
|
||||
{
|
||||
struct gc_atomic_forward fwd = gc_atomic_forward_begin(ref);
|
||||
GC_ASSERT_EQ(fwd.state, GC_FORWARDING_STATE_NOT_FORWARDED);
|
||||
}
|
||||
|
||||
static void
|
||||
nofl_space_verify_sweepable_blocks(struct nofl_space *space,
|
||||
struct nofl_block_list *list)
|
||||
|
@ -1401,6 +1408,8 @@ nofl_space_verify_sweepable_blocks(struct nofl_space *space,
|
|||
gc_trace_object(obj, NULL, NULL, NULL, &trace_bytes);
|
||||
size_t trace_granules = nofl_size_to_granules(trace_bytes);
|
||||
GC_ASSERT_EQ(granules, trace_granules);
|
||||
|
||||
nofl_assert_not_forwarded(obj);
|
||||
}
|
||||
|
||||
meta += granules;
|
||||
|
@ -1441,6 +1450,8 @@ nofl_space_verify_swept_blocks(struct nofl_space *space,
|
|||
gc_trace_object(obj, NULL, NULL, NULL, &trace_bytes);
|
||||
size_t trace_granules = nofl_size_to_granules(trace_bytes);
|
||||
GC_ASSERT_EQ(granules, trace_granules);
|
||||
|
||||
nofl_assert_not_forwarded(obj);
|
||||
}
|
||||
|
||||
meta += granules;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue