From 1d14dff64b4848c8df60c5498ae810d862205f3d Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 31 Dec 2018 17:52:04 -0500 Subject: Split up allocations into pages --- src/lib/utils/mem_pool/mem_pool.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/lib/utils/mem_pool/mem_pool.h') diff --git a/src/lib/utils/mem_pool/mem_pool.h b/src/lib/utils/mem_pool/mem_pool.h index 8f497310c..e10ec3bb8 100644 --- a/src/lib/utils/mem_pool/mem_pool.h +++ b/src/lib/utils/mem_pool/mem_pool.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -22,13 +23,11 @@ class BOTAN_TEST_API Memory_Pool final /** * Initialize a memory pool. The memory is not owned by *this, * it must be freed by the caller. - * @param pool the pool - * @param page_count size of pool in page_size chunks - * @param page_size some nominal page size (does not need to match - * the system page size) + * @param pages a list of pages to allocate from + * @param page_size the system page size, each page should + * point to exactly this much memory. */ - Memory_Pool(uint8_t* pool, - size_t page_count, + Memory_Pool(const std::vector& pages, size_t page_size); ~Memory_Pool(); @@ -50,9 +49,6 @@ class BOTAN_TEST_API Memory_Pool final std::deque m_free_pages; std::map> m_buckets_for; - - uint8_t* m_pool = nullptr; - size_t m_pool_size = 0; }; } -- cgit v1.2.3