From eb2211217858d97256c802739531547c52d328a5 Mon Sep 17 00:00:00 2001 From: krangelov Date: Sun, 16 Dec 2018 07:46:14 +0100 Subject: a pool where the smallest chunks are memory pages --- src/runtime/c/gu/mem.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/runtime/c/gu/mem.h') diff --git a/src/runtime/c/gu/mem.h b/src/runtime/c/gu/mem.h index 3f16a6a1c..f26e4d3a4 100644 --- a/src/runtime/c/gu/mem.h +++ b/src/runtime/c/gu/mem.h @@ -55,6 +55,11 @@ gu_local_pool_(uint8_t* init_buf, size_t sz); * should not be used in the bodies of recursive functions. */ +/// Create a pool where each chunk is corresponds to one or +/// more pages. +GU_API GuPool* +gu_new_page_pool(void); + /// Create a pool stored in a memory mapped file. GU_API_DECL GuPool* gu_mmap_pool(char* fpath, void* addr, size_t size, void**pptr); @@ -198,6 +203,9 @@ gu_mem_buf_realloc( size_t min_size, size_t* real_size_out); +/// Allocate enough memory pages to contain min_size bytes. +GU_API void* +gu_mem_page_alloc(size_t min_size, size_t* real_size_out); /// Free a memory buffer. GU_API_DECL void -- cgit v1.2.3