aboutsummaryrefslogtreecommitdiff
path: root/include/kpl/env.h
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-10-24 20:06:26 -0400
committernodist <kevin.comas.git@gmail.com>2026-10-24 20:06:26 -0400
commit19eb183b38511998322d99c33515c079d89785e3 (patch)
tree3d0446b1d2fe6a99ea2e9a6c1300516bfba1f590 /include/kpl/env.h
parent689719e0a1f139e28e57a4df334d5fde354b3379 (diff)
add kpl_identifier
Diffstat (limited to 'include/kpl/env.h')
-rw-r--r--include/kpl/env.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/kpl/env.h b/include/kpl/env.h
index 1e3d3d8..5ea3b33 100644
--- a/include/kpl/env.h
+++ b/include/kpl/env.h
@@ -14,6 +14,7 @@ typedef enum : int32_t {
typedef struct _kpl_thread {
uint16_t thread_id; // self id
kpl_memory_allocator memory_allocator;
+ _Atomic ssize_t gc_cycle_change; // number of objects added(+)/removed(-) to gc_head after last sweep
kpl_object *gc_head, *gc_mark_head; // sweep if not marked or not in io pending
kpl_io_uring io_uring;
// TODO jit allocator
@@ -40,7 +41,6 @@ typedef enum : uint32_t {
* kpl_env_config &env, argc, argv
* kpl_env_init &env
* add to the namespace tree
- * add a file load task, string evaluate task or REPL task to main thread task queue
* kpl_env_run &env
* kpl_env_free &env
*/
@@ -51,8 +51,9 @@ typedef struct _kpl_env {
const char *kpl_entry; // file or string to be ran, not used for repl, pointer used to get kpl args namespace
_Atomic ssize_t total_priority; // the sum of the threads priority fields, application stops on zero
kpl_thread *threads; // 0 is main thread, >= 1 are spawned pthreads
- // TODO namespace tree
- // TODO module tree
+ kpl_tree namespace_tree, module_tree; // Trees of kpl_storage
+ pthread_mutex_t module_tree_mutex;
+ // TODO jit
} kpl_env; // kpl state, no globals, must be zero initialized
/*