diff options
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/index.md | 7 | ||||
| -rw-r--r-- | docs/application/memory.md | 2 | ||||
| -rw-r--r-- | docs/application/thread.md | 2 | ||||
| -rw-r--r-- | docs/application/type.md | 18 |
4 files changed, 20 insertions, 9 deletions
diff --git a/docs/application/index.md b/docs/application/index.md index e315baf..6c84525 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -34,9 +34,8 @@ 1. Configuration * `thread_count` - defaults to number of available processors -2. Initialize tasks 2. Initialize allocators - * Slab sizes +3. Initialize tasks 4. Initialize types * Built In Alias 5. Initialize IO @@ -65,5 +64,5 @@ 1. Clean up IO 2. Clean up types -3. Clean up allocators -4. Clean up tasks +3. Clean up tasks +4. Clean up allocators diff --git a/docs/application/memory.md b/docs/application/memory.md index 44a3786..e180b24 100644 --- a/docs/application/memory.md +++ b/docs/application/memory.md @@ -25,7 +25,7 @@ Requires a ring buffer for each power of two ```c #define KPL_DYANMIC_OBJ_MIN_BITS 7 -#define KPL_DYNAMIC_OBJ_MAX_BITS 27 +#define KPL_DYNAMIC_OBJ_MAX_BITS 30 #define KPL_DYNAMIC_OBJ_MIN_SIZE (1 << KPL_DYANMIC_OBJ_MIN_BITS) diff --git a/docs/application/thread.md b/docs/application/thread.md index 6d3f76f..956c8ff 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -37,7 +37,7 @@ typedef struct { typedef struct { kpl_task_queue queue; - _Atomic ssize_t priority; + _Atomic size_t priority; sem_t counter; pthread_t thread; } kpl_thread; diff --git a/docs/application/type.md b/docs/application/type.md index 40546c1..bb9534b 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -9,11 +9,12 @@ typedef enum : uint8_t { // ... } kpl_type_template; -typedef enum { +typedef enum : uint8_t { CONST = 1 << 0, EMPTY = 1 << 1, REF = 1 << 2, - SHARED = 1 << 3 + SHARED = 1 << 3, + RETURN = 1 << 4 } kpl_type_qualifiers; typedef union { @@ -32,5 +33,16 @@ typedef struct { kpl_type_body body; } kpl_type; -// TODO SLAB WITH POOL +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; ``` |
