aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzer
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-31 17:52:04 -0500
committerJack Lloyd <[email protected]>2019-01-05 08:50:40 -0500
commit1d14dff64b4848c8df60c5498ae810d862205f3d (patch)
tree08f143e983214b1fb75eeda1b468580789b44a37 /src/fuzzer
parentb40d4c0e9c134a3daf9d77ce6f8a7b1271feb5ca (diff)
Split up allocations into pages
Diffstat (limited to 'src/fuzzer')
-rw-r--r--src/fuzzer/mem_pool.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fuzzer/mem_pool.cpp b/src/fuzzer/mem_pool.cpp
index 14b0fb574..d6305997d 100644
--- a/src/fuzzer/mem_pool.cpp
+++ b/src/fuzzer/mem_pool.cpp
@@ -30,11 +30,14 @@ size_t compute_expected_alignment(size_t plen)
void fuzz(const uint8_t in[], size_t in_len)
{
const size_t page_size = 4096;
- const size_t pages = 4;
- static std::vector<uint8_t> raw_mem(page_size * pages);
+ static std::vector<void*> raw_mem{malloc(page_size),
+ malloc(page_size),
+ malloc(page_size),
+ malloc(page_size)};
- Botan::Memory_Pool pool(raw_mem.data(), pages, page_size);
+
+ Botan::Memory_Pool pool(raw_mem, page_size);
std::map<uint8_t*, size_t> ptrs;
while(in_len > 0)