summaryrefslogtreecommitdiff
path: root/docs/application/gc.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-09 10:07:44 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-09 10:07:44 -0400
commit4da9de3213a28c7e17945168acdb06308bb41df8 (patch)
tree6bc6a3ff8653eb7bfe6591c36a7ab9b491649b9d /docs/application/gc.md
parentfaac96fff84c45acf20af0515e8fd43af32fdaca (diff)
use group for tuple and table
Diffstat (limited to 'docs/application/gc.md')
-rw-r--r--docs/application/gc.md10
1 files changed, 5 insertions, 5 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`