2019-04-11 22:34:20 +02:00
|
|
|
#pragma once
|
|
|
|
#include "paging.h"
|
|
|
|
#include "stdarg.h"
|
|
|
|
|
2019-04-16 23:12:16 +02:00
|
|
|
struct slabEntry {
|
2020-04-27 00:14:37 +02:00
|
|
|
vaddr_t page;
|
|
|
|
void *freeEl;
|
|
|
|
char full;
|
|
|
|
struct slabEntry *next;
|
|
|
|
struct slabEntry *prev;
|
2019-04-16 23:12:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct slabDesc {
|
2020-04-27 00:14:37 +02:00
|
|
|
struct slabEntry slab;
|
|
|
|
size_t size;
|
|
|
|
struct slabDesc *next;
|
|
|
|
struct slabDesc *prev;
|
2019-04-11 22:34:20 +02:00
|
|
|
};
|
2020-04-29 23:07:01 +02:00
|
|
|
int allocSetup(void);
|
2019-04-15 22:48:37 +02:00
|
|
|
int allocBookSlab(size_t size, int selfContained);
|
2019-04-11 22:34:20 +02:00
|
|
|
|
|
|
|
void *malloc(size_t size);
|
2020-04-27 00:14:37 +02:00
|
|
|
void free(void *ptr);
|