summaryrefslogtreecommitdiff
path: root/docs/application
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-07-15 20:40:49 -0400
committernodist <kevin.comas.git@gmail.com>2026-07-15 20:40:49 -0400
commit224c245a875a6f28c01e93d037329c708ef81dd4 (patch)
tree7a368ccb80743651d5eb2f4b30a788ef70dae0ee /docs/application
parent4c008d258f6fd23fd64e2a6b059448748d7f7d24 (diff)
type var definitions
Diffstat (limited to 'docs/application')
-rw-r--r--docs/application/group.md1
-rw-r--r--docs/application/index.md10
-rw-r--r--docs/application/namespace.md29
-rw-r--r--docs/application/type.md16
4 files changed, 34 insertions, 22 deletions
diff --git a/docs/application/group.md b/docs/application/group.md
index 1294afe..7ed6382 100644
--- a/docs/application/group.md
+++ b/docs/application/group.md
@@ -7,6 +7,7 @@
```c
typedef struct _kpl_group {
KPL_DYNAMIC_OBJ_HEADER();
+ int32_t item_length;
kpl_class items[];
} kpl_group;
```
diff --git a/docs/application/index.md b/docs/application/index.md
index 6c84525..0dd4b7e 100644
--- a/docs/application/index.md
+++ b/docs/application/index.md
@@ -40,6 +40,7 @@
* Built In Alias
5. Initialize IO
* Size of registered sparse buffers
+6. Initialize Jit
## Main
@@ -62,7 +63,8 @@
## Shutdown
-1. Clean up IO
-2. Clean up types
-3. Clean up tasks
-4. Clean up allocators
+1. Clean up Jit
+2. Clean up IO
+3. Clean up types
+4. Clean up tasks
+5. Clean up allocators
diff --git a/docs/application/namespace.md b/docs/application/namespace.md
index e9842cd..cd1f89e 100644
--- a/docs/application/namespace.md
+++ b/docs/application/namespace.md
@@ -5,29 +5,24 @@
## Object Definitions
```c
-typedef struct _kpl_export {
- int32_t tree_weight;
- struct _kpl_export *tree_left, *tree_right;
- kpl_type *type;
-} kpl_export;
+#define KPL_TREE_HEADER() uint32_t tree_weight, module_id; struct _kpl_namespace_tree *tree_left, *tree_right; kpl_buffer *name
+
+typedef struct _kpl_namespace_tree {
+ KPL_TREE_HEADER();
+} kpl_namespace_tree_obj;
typedef struct _kpl_namespace_native {
- int32_t tree_weight;
- struct _kpl_namespace_native *tree_left, *tree_right;
- const char *name;
- kpl_export *export_tree;
+ KPL_TREE_HEADER();
+ kpl_type *export_var_tree;
} kpl_namespace_native;
static kpl_namespace_native *namespace_native_tree;
typedef struct _kpl_namespace_module {
- uint32_t module_id;
- int32_t tree_weight;
- struct _kpl_namespace_module *tree_left, *tree_right;
- kpl_buffer *module_string, *module_name;
- kpl_export *export_tree;
+ KPL_TREE_HEADER();
+ kpl_buffer *body;
+ kpl_type *ast, *export_var_tree;
kpl_mutex export_mutex;
- kpl_type *ast;
} kpl_namespace_module;
static kpl_namespace_module *namespace_module_tree;
@@ -73,7 +68,7 @@ Add a [Register](../lifecycle/register.md) task to `namespace_module_mutex`
### ``export`
-Add exports directly to the namespaces `export_tree`, thread safe
+Add exports directly to the namespaces `export_var_tree`, thread safe
## String/REPL
@@ -94,7 +89,7 @@ Since the native modules are loaded statically the `native_module_tree` becomes
1. Add find namespace task to the `namespace_module_mutex`, the namespace not existing is an error
2. Add a get export task to the namespaces `export_mutex`
3. The `export_mutex` will not start processing it's queue until the namespace notifies that it's and unlocks its `export_mutex`
-4. The importer will get a copy of the read only `export_tree`
+4. The importer will get a copy of the read only `export_var_tree`
# AVL Tree Storage and Lookup
diff --git a/docs/application/type.md b/docs/application/type.md
index f028fba..3a831b2 100644
--- a/docs/application/type.md
+++ b/docs/application/type.md
@@ -26,6 +26,17 @@ typedef struct {
int32_t position, module_id;
} kpl_token;
+typedef enum {
+ NONE,
+ GENERAL_REGISTER,
+ XMM_REGISTER,
+ STACK
+} kpl_native_storage;
+
+typedef struct {
+ uint8_t storage : 2, id : 6;
+} kpl_native_id;
+
typedef struct _kpl_type {
kpl_type_template template;
uint8_t qualifiers;
@@ -33,7 +44,10 @@ typedef struct _kpl_type {
union {
kpl_token token;
struct {
- int32_t id, tree_weight;
+ kpl_native_id native_id;
+ int8_t process_state_id; // -1 not used
+ uint16_t tree_weight;
+ struct _kpl_type *function;
} var;
} meta;
_Atomic ssize_t ref_count;