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
10
typedef
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
19
typedef
struct
{
20
Slab* slabsFull;
21
Slab* slabsPartial;
22
Slab* slabsEmpty;
23
24
uint32_t objectSize;
25
}
KernelMemoryCache
;
26
27
KernelMemoryCache
cacheCreate(uint32_t objectSize);
28
void
* cacheAlloc(
KernelMemoryCache
* cache);
29
void
cacheFree(
KernelMemoryCache
* cache,
void
*
object
);
30
31
#endif
//BLU_OS_SLAB_H
stdint.h
Fixed-width integer types.
KernelMemoryCache
Definition
slab.h:19
slab
Definition
slab.h:10
kernel
include
kernel
mm
slab.h
Generated by
1.16.1