diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-24 20:06:26 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-24 20:06:26 -0400 |
| commit | 19eb183b38511998322d99c33515c079d89785e3 (patch) | |
| tree | 3d0446b1d2fe6a99ea2e9a6c1300516bfba1f590 /include/kpl/allocate.h | |
| parent | 689719e0a1f139e28e57a4df334d5fde354b3379 (diff) | |
add kpl_identifier
Diffstat (limited to 'include/kpl/allocate.h')
| -rw-r--r-- | include/kpl/allocate.h | 5 |
1 files changed, 4 insertions, 1 deletions
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--; } |
