1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-27 21:40:34 +02:00

Add assertions when pushing edge buffers

This commit is contained in:
Andy Wingo 2024-10-04 13:50:35 +02:00
parent 15a51c8a85
commit 478b9de798

View file

@ -44,6 +44,7 @@ struct gc_field_set_writer {
static void
gc_edge_buffer_list_push(struct gc_edge_buffer_list *list,
struct gc_edge_buffer *buf) {
GC_ASSERT(!buf->next);
struct gc_edge_buffer *next =
atomic_load_explicit(&list->head, memory_order_relaxed);
do {
@ -72,6 +73,7 @@ static void
gc_edge_buffer_stack_push(struct gc_edge_buffer_stack *stack,
struct gc_edge_buffer *buf,
const struct gc_lock *lock) {
GC_ASSERT(!buf->next);
buf->next = stack->list.head;
stack->list.head = buf;
}