1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Memory pages allocator is now a global simple lockless structure

This commit is contained in:
Maria Matejka
2022-09-09 20:57:59 +02:00
parent 3d627d09d4
commit b80823fe82
4 changed files with 66 additions and 65 deletions

View File

@@ -122,6 +122,7 @@ void buffer_realloc(void **buf, unsigned *size, unsigned need, unsigned item_siz
/* Allocator of whole pages; for use in slabs and other high-level allocators. */
#define PAGE_HEAD(x) ((void *) (((uintptr_t) (x)) & ~(page_size-1)))
extern long page_size;
extern _Atomic int pages_kept;
void *alloc_page(void);
void free_page(void *);