From 730faa451fbc3e7ae37c8a3b32b9d4d99007c666 Mon Sep 17 00:00:00 2001 From: nodist Date: Sat, 11 Jul 2026 19:52:56 -0400 Subject: remove compressed pointers --- docs/application/identifier.md | 4 ++-- docs/application/interface.md | 6 ------ docs/application/namespace.md | 13 ++++++++----- docs/application/thread.md | 2 -- docs/application/type.md | 29 +++++++++++------------------ 5 files changed, 21 insertions(+), 33 deletions(-) (limited to 'docs/application') diff --git a/docs/application/identifier.md b/docs/application/identifier.md index 47dcd79..ed4f3e7 100644 --- a/docs/application/identifier.md +++ b/docs/application/identifier.md @@ -7,9 +7,9 @@ Store vars, types and symbols as compressed strings ## Object Definitions ```c -#define KPL_IDENTIFIER_PARTS 6 +#define KPL_IDENTIFIER_PARTS 5 -// TODO 60 charaters of [A-Za-z0-9_] in 48 bytes +// TODO 50 charaters of [A-Za-z0-9_] in 40 bytes typedef struct { uint64_t parts[KPL_IDENTIFIER_PARTS]; diff --git a/docs/application/interface.md b/docs/application/interface.md index 9a7fa22..de9eebe 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -49,12 +49,6 @@ kpl_result kpl_result_error(error *er); kpl_result kpl_result_null(void); kpl_result kpl_result_value(any value); - -typdef struct { - uint16_t slab_index, array_index; -} kpl_ptr; - -#define KPL_PTR_NULL (kpl_ptr) { .slab_index = UINT16_MAX, .array_index = UINT16_MAX } ``` ## `kpl_interface` diff --git a/docs/application/namespace.md b/docs/application/namespace.md index ac382de..f8653f7 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -6,13 +6,13 @@ ```c typedef struct _kpl_export { - size_t tree_weight; + int32_t tree_weight; struct _kpl_export *tree_left, *tree_right; - kpl_type_ptr type; + kpl_type *type; } kpl_export; typedef struct _kpl_namespace_native { - size_t tree_weight; + int32_t tree_weight; struct _kpl_namespace_native *tree_left, *tree_right; const char *name; kpl_export *export_tree; @@ -21,12 +21,13 @@ typedef struct _kpl_namespace_native { static kpl_namespace_native *namespace_native_tree; typedef struct _kpl_namespace_module { - size_t tree_weight; + 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_mutex export_mutex; - kpl_type_ptr ast; + kpl_type *ast; } kpl_namespace_module; static kpl_namespace_module *namespace_module_tree; @@ -34,6 +35,8 @@ static kpl_namespace_module *namespace_module_tree; kpl_mutex namespace_modul_tree_mutex; static kpl_namespace_module namespace_string; + +static kpl_namespace_module *module_array[KPL_MODULE_SIZE]; // module_id refers to index ``` Each `NAMESPACE_IDENTIFIER` maps to `kpl_namespace_native*` or `kpl_namespace_module*` depending on flags diff --git a/docs/application/thread.md b/docs/application/thread.md index 956c8ff..e5b3981 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -33,8 +33,6 @@ typedef struct { } dummy; } kpl_task_queue; -// TODO RING BUFFER ALLOCATOR - typedef struct { kpl_task_queue queue; _Atomic size_t priority; diff --git a/docs/application/type.md b/docs/application/type.md index bb9534b..25a5863 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -21,28 +21,21 @@ typedef union { // 64 Bytes Max } kpl_type_body; -typedef struct { +typedef struct _kpl_type { kpl_type_template template; uint8_t qualifiers; uint16_t modifiers; - uint16_t token_length, token_line; - uint32_t token_position; + union { + struct { + uint16_t length, line; + uint32_t position, module_id; + } token; + struct { + int32_t id, tree_weight; + } var; + } meta; _Atomic int32_t ref_count; - kpl_ptr self, prev, next; - kpl_namespace_module *module; + struct _kpl_type *prev, *next; kpl_type_body body; } kpl_type; - -uint16_t array_index, slab_count; - -typedef struct _kpl_type_slab { - struct _kpl_type_slab *next; - kpl_type array[UINT16_MAX]; -} kpl_type_slab; - -kpl_type_slab *type_slab; - -kpl_ptr type_pool; - -kpl_mutex type_mutex; ``` -- cgit v1.2.3