aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-12 02:46:59 +0000
committerlloyd <[email protected]>2008-04-12 02:46:59 +0000
commit21669116db5ccb075d92a24af763f7b8c7a32976 (patch)
treeafca213e9b0fd6ea87043df29c9e21074e19da03 /include
parent04b702def2a883eada14a505955d6b369e9de88f (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.h1
-rw-r--r--include/mem_pool.h4
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;