diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-06-09 10:07:44 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-06-09 10:07:44 -0400 |
| commit | 4da9de3213a28c7e17945168acdb06308bb41df8 (patch) | |
| tree | 6bc6a3ff8653eb7bfe6591c36a7ab9b491649b9d /docs/application | |
| parent | faac96fff84c45acf20af0515e8fd43af32fdaca (diff) | |
use group for tuple and table
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/gc.md | 10 | ||||
| -rw-r--r-- | docs/application/group.md (renamed from docs/application/tuple.md) | 8 | ||||
| -rw-r--r-- | docs/application/index.md | 2 | ||||
| -rw-r--r-- | docs/application/namespace.md | 4 | ||||
| -rw-r--r-- | docs/application/thread.md | 4 |
5 files changed, 15 insertions, 13 deletions
diff --git a/docs/application/gc.md b/docs/application/gc.md index 9364e12..ff538ee 100644 --- a/docs/application/gc.md +++ b/docs/application/gc.md @@ -15,16 +15,16 @@ typedef struct _kpl_gc { pthread_mutex_t mutex; } kpl_gc; -static _Atomic size_t marked_threads; +static _Atomic size_t gc_threads; -static kpl_gc *old_gc_head, *gc_head, *gc_tail; +static kpl_gc *old_gc_head, *gc_head; ``` ## Counting `ref_count` starts at 1 -Each assign increments the reference count, each time it goes out of scope the reference count is decreased +Each assign increments the `ref_count`, each time it goes out of scope the `ref_count` is decreased When `ref_count` hits 0, data is freed @@ -33,6 +33,6 @@ When `ref_count` hits 0, data is freed 1. Once triggered add a init task to the async queue 2. This task moves the `gc_head` to the `old_gc_head` and sets the `gc_wait` to off for each thread 3. Each thread will run down its queue queue marking found gc objects -3. Once all have run and `marked_threads == available_threads` add a mark and sweep task to the async queue +3. Once all have run and `gc_threads == available_threads` add a mark and sweep task to the async queue 4. Async task goes down async queue and does final mark, then a sweep on the `old_gc_head` is done -5. What remains on the `old_gc_head` is added to the gc tail +5. What remains on the `old_gc_head` is added to `gc_head` diff --git a/docs/application/tuple.md b/docs/application/group.md index e0e926c..2d5ed4b 100644 --- a/docs/application/tuple.md +++ b/docs/application/group.md @@ -1,13 +1,13 @@ -# Tuple +# Group --- ## Object Definitions ```c -typedef struct _kpl_tuple { - POOL_HEADER(_kpl_tuple); +typedef struct _kpl_group { + POOL_HEADER(_kpl_group); uint32_t item_length; kpl_class items[]; -} kpl_tuple; +} kpl_group; ``` diff --git a/docs/application/index.md b/docs/application/index.md index f4a013b..9f316bc 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -16,7 +16,7 @@ * ##### [Thread](./thread.md) * ##### [Io](./io.md) * ##### [Gc](./gc.md) -* ##### [Tuple](./tuple.md) +* ##### [Group](./group.md) * ##### [Buffer](./buffer.md) * ##### [Map](./map.md) * ##### [Queue](./queue.md) diff --git a/docs/application/namespace.md b/docs/application/namespace.md index 6891376..41d9ee5 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -7,11 +7,13 @@ ```c typedef struct _kpl_export { POOL_HEADER(_kpl_export); - _Atomic int32_t ref_count; + kpl_type_ptr type; kpl_buffer *name; kpl_class *class; } kpl_export; +static kpl_export *export_head; + typedef struct _kpl_native_namespace { POOL_HEADER(_kpl_native_namespace); kpl_buffer *name; diff --git a/docs/application/thread.md b/docs/application/thread.md index ba67a7e..7e13d71 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -14,7 +14,7 @@ typedef struct _kpl_task { _Atomic bool join_ready; uint16_t worker_id; kpl_task_fn *fn; - kpl_tuple *state; + kpl_group *state; kpl_interface *ret_interface; kpl_result ret; } kpl_task; @@ -45,7 +45,7 @@ static kpl_thread threads[KPL_MAX_THREADS]; ```text 0 -> length native : arguments -process : arguments, locals +process : arguments, locals, parent closure : arguments, locals, closure function iterator : arguments, locals, iterator functions, iterator function index ``` |
