From 19eb183b38511998322d99c33515c079d89785e3 Mon Sep 17 00:00:00 2001 From: nodist Date: Sat, 24 Oct 2026 20:06:26 -0400 Subject: add kpl_identifier --- include/kpl/allocate.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/kpl/allocate.h') diff --git a/include/kpl/allocate.h b/include/kpl/allocate.h index ee24d72..3da4a10 100644 --- a/include/kpl/allocate.h +++ b/include/kpl/allocate.h @@ -19,6 +19,7 @@ inline void *kpl_object_allocate(kpl_thread *thread, int32_t size) { if (thread->gc_head) thread->gc_head->gc_prev = obj; thread->gc_head = obj; + thread->gc_cycle_change++; return obj; } @@ -31,5 +32,7 @@ inline void kpl_object_return(kpl_env *env, void *object) { obj->gc_prev->gc_next = obj->gc_next; if (obj->gc_next) obj->gc_next->gc_prev = obj->gc_prev; - kpl_memory_allocator_return(&env->threads[obj->thread_id].memory_allocator, object); + kpl_thread *thread = &env->threads[obj->thread_id]; + kpl_memory_allocator_return(&thread->memory_allocator, object); + thread->gc_cycle_change--; } -- cgit v1.2.3