matos/core/alloc.h

25 lines
460 B
C
Raw Normal View History

2019-04-11 22:34:20 +02:00
#pragma once
#include "paging.h"
#include "stdarg.h"
struct slabEntry {
vaddr_t page;
2020-08-28 22:38:05 +02:00
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;
2019-04-11 22:34:20 +02:00
};
2020-04-29 23:07:01 +02:00
int allocSetup(void);
2020-08-28 22:38:05 +02:00
int allocBookSlab(size_t size, size_t sizeSlab, int selfContained);
2019-04-11 22:34:20 +02:00
void *malloc(size_t size);
void free(void *ptr);