Initial commit

This commit is contained in:
ssimnb 2026-01-22 08:05:43 +01:00
parent 3ba3e98f6b
commit 1dd7b8b07f
3 changed files with 103 additions and 1 deletions

38
slaballoc.h Normal file
View file

@ -0,0 +1,38 @@
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#define KCACHE_NAME_LEN 5
struct ma_bufctrl {
struct ma_bufctrl *next;
size_t *startaddr;
};
struct ma_slab {
struct ma_slab *next;
struct ma_slab *prev;
struct ma_bufctrl *buf_list;
uint32_t refcount;
};
struct ma_kcache {
struct ma_kcache *next;
struct ma_kcache *prev;
uint32_t objsize;
uint32_t flags;
uint32_t num;
struct ma_slab *slabs_free;
struct ma_slab *slabs_partial;
struct ma_slab *slabs_used;
struct ma_bufctrl *bufctrl_arr;
char name[KCACHE_NAME_LEN];
};