Generic lock-free kmalloc cache implementation
Conflicts: kernel/mem.c
This commit is contained in:
@@ -19,6 +19,15 @@
|
||||
void panic(const char *);
|
||||
int kprintf(const char *format, ...);
|
||||
|
||||
struct kmalloc_cache_header {
|
||||
struct kmalloc_cache_header *next;
|
||||
};
|
||||
|
||||
void *kmalloc_cache_alloc(struct kmalloc_cache_header *cache,
|
||||
size_t size);
|
||||
void kmalloc_cache_free(struct kmalloc_cache_header *cache,
|
||||
void *elem);
|
||||
|
||||
#define kmalloc(size, flag) ({\
|
||||
void *r = _kmalloc(size, flag, __FILE__, __LINE__);\
|
||||
if(r == NULL){\
|
||||
|
||||
Reference in New Issue
Block a user