stos: pool: Add pool allocation header + tag usage

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-26 21:20:57 +00:00
parent e65af3fce0
commit 5f6ec72598
2 changed files with 29 additions and 5 deletions
+17
View File
@@ -32,6 +32,9 @@
#define POOL_REAL_PAGESZ \
(PAGESIZE - sizeof(MEMORY_PAGE))
/* Used to prevent corruption */
#define POOL_MAGIC 0xCA7F00D
/*
* Valid pool types
*
@@ -41,6 +44,20 @@ typedef enum {
POOL_NON_PAGED
} POOL_TYPE;
/*
* Represents the header that goes before each returned
* and allocated block.
*
* @Magic: Magic numbers
* @MemoryTag: Tag assigned at allocation
* @Length: Length of memory allocation
*/
typedef struct PACKED {
ULONG Magic;
ULONG MemoryTag;
USIZE Length;
} MEMORY_HEADER;
/*
* Page data structure used internally to link together page
* lists