diff options
author | Maria Matejka <mq@ucw.cz> | 2021-09-01 00:46:46 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-09-10 18:13:50 +0200 |
commit | 7f0e59820899c30a243c18556ce2e3fb72d6d221 (patch) | |
tree | c91b070b707c3c7788925619e625f465c2b290a2 /lib/resource.h | |
parent | 2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9 (diff) |
Bound allocated pages to resource pools with page caches to avoid unnecessary syscalls
Diffstat (limited to 'lib/resource.h')
-rw-r--r-- | lib/resource.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/resource.h b/lib/resource.h index e65455c8..597d6c17 100644 --- a/lib/resource.h +++ b/lib/resource.h @@ -94,10 +94,12 @@ void sl_free(slab *, void *); void buffer_realloc(void **buf, unsigned *size, unsigned need, unsigned item_size); +extern long page_size; + /* Allocator of whole pages; for use in slabs and other high-level allocators. */ -u64 get_page_size(void); -void *alloc_page(void); -void free_page(void *); +void *alloc_page(pool *); +void free_page(pool *, void *); +#define PAGE_HEAD(x) ((void *) (((intptr_t) (x)) & ~(page_size-1))) #ifdef HAVE_LIBDMALLOC /* |