From 168e070965aa2d98326b297d10339c4ad131c560 Mon Sep 17 00:00:00 2001 From: nodist Date: Mon, 8 Jun 2026 17:52:05 -0400 Subject: add gc and shared as a qualifier type --- docs/application/gc.md | 12 ++++++++++++ docs/application/index.md | 1 + docs/application/type.md | 12 +++++++++++- docs/language/index.md | 2 +- docs/type_system/bit.md | 4 ++++ docs/type_system/index.md | 8 ++++---- mkdocs.yml | 5 +++-- 7 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 docs/application/gc.md diff --git a/docs/application/gc.md b/docs/application/gc.md new file mode 100644 index 0000000..7353db9 --- /dev/null +++ b/docs/application/gc.md @@ -0,0 +1,12 @@ +# Garbage Collection + +--- + +## Object Definition + +```c +typedef struct _kpl_gc_count { + _Atomic size_t ref_count; + kpl_any any; +} kpl_gc_count; +``` diff --git a/docs/application/index.md b/docs/application/index.md index 68bd1a1..f4a013b 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -15,6 +15,7 @@ * ##### [Pool](./pool.md) * ##### [Thread](./thread.md) * ##### [Io](./io.md) +* ##### [Gc](./gc.md) * ##### [Tuple](./tuple.md) * ##### [Buffer](./buffer.md) * ##### [Map](./map.md) diff --git a/docs/application/type.md b/docs/application/type.md index 77c567d..a89302e 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -15,16 +15,26 @@ typedef struct { static const kpl_type_ptr kpl_type_ptr_null = { UINT16_MAX, UINT16_MAX }; -typedef enum : uint16_t { +typedef enum : uint8_t { // ... } kpl_type_template; +typedef enum : uint8_t { + CONST = 1 << 0 + EMPTY = 1 << 1, + REF = 1 << 2, + SHARED = 1 << 3, + COUTING = 1 << 4, + TRACING = 1 << 5 +} kpl_type_flags; + typedef union { // ... } kpl_type_body; typedef struct { kpl_type_template template; + kpl_type_flags flags; _Atomic unt16_t ref_count; kpl_type_ptr self, prev, next, parent; kpl_type_body body; diff --git a/docs/language/index.md b/docs/language/index.md index 5d1b31f..8925f96 100644 --- a/docs/language/index.md +++ b/docs/language/index.md @@ -121,7 +121,7 @@ Type[arg] ## Destructuring ```text -v : Tuple(1; 2; 3) +v : Tuple $ (1; 2; 3) v [a; b; c] `log a // I64.a $ 1 `log b // I64.b $ 2 diff --git a/docs/type_system/bit.md b/docs/type_system/bit.md index 5f7aa8e..e07c804 100644 --- a/docs/type_system/bit.md +++ b/docs/type_system/bit.md @@ -104,3 +104,7 @@ Bool `alias Bit[.bit8; .bool] ### ``bit_ls` ### ``bit_rs` + +## Other + +### Compare `<=>` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 36d1142..eb788d4 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -50,8 +50,6 @@ Denotes that a field that does not resolve to anything * #### [Native](./native.md) -* #### [Shared](./shared.md) - * #### [Error](./error.md) ## Qualifier Templates @@ -60,10 +58,10 @@ Denotes that a field that does not resolve to anything * #### [Empty](./empty.md) -* #### [Lock](./lock.md) - * #### [Ref](./ref.md) +* #### [Shared](./shared.md) + ## Function Templates * #### [Var](./var.md) @@ -86,4 +84,6 @@ Denotes that a field that does not resolve to anything * #### [List](./list.md) +* #### [Lock](./lock.md) + * #### [Namespace](./namespace.md) diff --git a/mkdocs.yml b/mkdocs.yml index 0741131..3ef859f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,12 +21,11 @@ nav: - Queue: 'type_system/queue.md' - Union: 'type_system/union.md' - Native: 'type_system/native.md' - - Shared: 'type_system/shared.md' - Error: 'type_system/error.md' - Const: 'type_system/const.md' - Empty: 'type_system/empty.md' - - Lock: 'type_system/lock.md' - Ref: 'type_system/ref.md' + - Shared: 'type_system/shared.md' - Var: 'type_system/var.md' - Fn: 'type_system/fn.md' - Task: 'type_system/task.md' @@ -36,6 +35,7 @@ nav: - Symbol: 'type_system/symbol.md' - Op: 'type_system/op.md' - List: 'type_system/list.md' + - Lock: 'type_system/lock.md' - Namespace: 'type_system/namespace.md' - Application: - Runtime: 'application/index.md' @@ -44,6 +44,7 @@ nav: - Pool: 'application/pool.md' - Thread: 'application/thread.md' - Io: 'application/io.md' + - Gc: 'application/gc.md' - Tuple: 'application/tuple.md' - Buffer: 'application/buffer.md' - Map: 'application/map.md' -- cgit v1.2.3