From 76601e59f4f45df04d467ac6673ebbd9ea79b753 Mon Sep 17 00:00:00 2001 From: nodist Date: Tue, 8 Sep 2026 10:42:31 -0400 Subject: new spec layout --- docs/allocator.md | 65 ------------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 docs/allocator.md (limited to 'docs/allocator.md') diff --git a/docs/allocator.md b/docs/allocator.md deleted file mode 100644 index 5885d76..0000000 --- a/docs/allocator.md +++ /dev/null @@ -1,65 +0,0 @@ -# Allocator - ---- - -KPL uses `mmap` to allocate slabs of non-executable and executable memory - -Once memory is used it is not returned to the OS until KPL exits - -## Non-Executable - -### Mapping - -Two linked list of pages is kept, tracing the size of map and how much is used: - -#### Small Page Allocator - -For allocations less then a page size `< 2 ^ 12` - -#### Large Page Allocator - -For allocations a page size or larger `>= 2 ^ 12` - -### Object Sizes - -Every Object KPL allocates is sized to the next power of 2 - -Because each power of two requires its own ring buffer, minimum allocation size is `2 ^ 6` and max is `2 ^ 27` - -### Ring Buffer Sizes - -The total number of objects each ring buffer can store can by modified by MACRO'S at compile time - -The program will exit if more objects are allocated then it's corresponding ring buffer can hold - -### Ring Buffer Implementation - -Each ring buffer is implemented as an atomic multi-producer multi-consumer queue - -### Operation - -#### Constructor - -#### Requesting Objects - -#### Returning Objects - -#### Destructor - -## Executable - -### Mapping - -A linked list of pages is kept, tracing the size of each map and how much is used - -### Operation - -#### Constructor - -#### Requesting Memory - -#### Writing To Memory - -#### Making Memory Executable - -#### Destructor -- cgit v1.2.3