From cf9285b1dbdf687630076149413f16e5d4af82e8 Mon Sep 17 00:00:00 2001 From: nodist Date: Sun, 28 Jun 2026 13:41:22 -0400 Subject: type body object definitions and garbage collection algo --- docs/application/memory.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'docs/application/memory.md') diff --git a/docs/application/memory.md b/docs/application/memory.md index f5f457c..a8e75b8 100644 --- a/docs/application/memory.md +++ b/docs/application/memory.md @@ -45,12 +45,17 @@ typdef strcut _kpl_slab_tree_obj { KPL_SLAB_TREE_HEADER(struct _kpl_slab_tree_obj); } kpl_slab_tree_obj; +typdef struct _kpl_slab_bucket { + struct _kpl_slab_bucket *next; + uint8_t byte_obj_array[]; +} kpl_slab_bucket; + typedef struct _kpl_slab { - KPL_ALLOC_HEADER(struct _kpl_slab); - uint32_t obj_size, byte_index; + uint16_t obj_count, obj_index; + uint32_t obj_size; kpl_slab_obj *pool; + kpl_slab_bucket *bucket; kpl_mutex mutex; - uint8_t byte_array[]; } kpl_slab; ``` @@ -64,8 +69,6 @@ Each bucket in the `kpl_alloc.pool` represents two to the power of the bucket in # Slab -Allocated by `kpl_alloc` - ## Pooling Objects for reuse are stored as a list by the `kpl_slab_obj.prev` on `kpl_slab.pool` -- cgit v1.2.3