25 lines
460 B
C
25 lines
460 B
C
#pragma once
|
|
#include "paging.h"
|
|
#include "stdarg.h"
|
|
|
|
struct slabEntry {
|
|
vaddr_t page;
|
|
size_t size;
|
|
void *freeEl;
|
|
char full;
|
|
struct slabEntry *next;
|
|
struct slabEntry *prev;
|
|
};
|
|
|
|
struct slabDesc {
|
|
struct slabEntry slab;
|
|
size_t size;
|
|
struct slabDesc *next;
|
|
struct slabDesc *prev;
|
|
};
|
|
int allocSetup(void);
|
|
int allocBookSlab(size_t size, size_t sizeSlab, int selfContained);
|
|
|
|
void *malloc(size_t size);
|
|
void free(void *ptr);
|