diff options
author | lloyd <[email protected]> | 2008-04-12 02:46:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-04-12 02:46:59 +0000 |
commit | 21669116db5ccb075d92a24af763f7b8c7a32976 (patch) | |
tree | afca213e9b0fd6ea87043df29c9e21074e19da03 /include | |
parent | 04b702def2a883eada14a505955d6b369e9de88f (diff) |
Make the memory allocator's chunk size a compile time constant, via a
new build.h macro BOTAN_MEM_POOL_CHUNK_SIZE
Diffstat (limited to 'include')
-rw-r--r-- | include/defalloc.h | 1 | ||||
-rw-r--r-- | include/mem_pool.h | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/include/defalloc.h b/include/defalloc.h index 69c162ac4..6d25909ff 100644 --- a/include/defalloc.h +++ b/include/defalloc.h @@ -28,7 +28,6 @@ class Malloc_Allocator : public Allocator class Locking_Allocator : public Pooling_Allocator { public: - Locking_Allocator() : Pooling_Allocator(64*1024, true) {} std::string type() const { return "locking"; } private: void* alloc_block(u32bit); diff --git a/include/mem_pool.h b/include/mem_pool.h index 9d6d8d31d..a39e88f07 100644 --- a/include/mem_pool.h +++ b/include/mem_pool.h @@ -25,7 +25,7 @@ class Pooling_Allocator : public Allocator void destroy(); - Pooling_Allocator(u32bit, bool); + Pooling_Allocator(); ~Pooling_Allocator(); private: void get_more_core(u32bit); @@ -61,7 +61,7 @@ class Pooling_Allocator : public Allocator byte* buffer, *buffer_end; }; - const u32bit PREF_SIZE; + static const u32bit PREF_SIZE = BOTAN_MEM_POOL_CHUNK_SIZE; std::vector<Memory_Block> blocks; std::vector<Memory_Block>::iterator last_used; |