blu_os
Loading...
Searching...
No Matches
slab.h
1//
2// Created by dylan on 19/07/2026.
3//
4
5#ifndef BLU_OS_SLAB_H
6#define BLU_OS_SLAB_H
7
8#include <stdint.h>
9
10typedef struct slab {
11 struct slab* next;
12 void* memory;
13 uint32_t objectSize;
14 uint32_t capacity;
15 uint32_t used;
16 void* freeList;
17} Slab;
18
19typedef struct {
20 Slab* slabsFull;
21 Slab* slabsPartial;
22 Slab* slabsEmpty;
23
24 uint32_t objectSize;
26
27KernelMemoryCache cacheCreate(uint32_t objectSize);
28void* cacheAlloc(KernelMemoryCache* cache);
29void cacheFree(KernelMemoryCache* cache, void* object);
30
31#endif //BLU_OS_SLAB_H
Fixed-width integer types.
Definition slab.h:19
Definition slab.h:10