summaryrefslogtreecommitdiff
path: root/src/runtime/c/gu/mem.h
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2018-12-16 07:46:14 +0100
committerkrangelov <kr.angelov@gmail.com>2018-12-16 07:46:14 +0100
commiteb2211217858d97256c802739531547c52d328a5 (patch)
tree578060a42d79a4a7c12a60d964b7df7cbb051b02 /src/runtime/c/gu/mem.h
parent083aa96e575554518dee32d03f579ad6cac26722 (diff)
a pool where the smallest chunks are memory pages
Diffstat (limited to 'src/runtime/c/gu/mem.h')
-rw-r--r--src/runtime/c/gu/mem.h8
1 files changed, 8 insertions, 0 deletions
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