aboutsummaryrefslogtreecommitdiffstats
path: root/include/defalloc.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/defalloc.h
Initial checkin1.5.6
Diffstat (limited to 'include/defalloc.h')
-rw-r--r--include/defalloc.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/defalloc.h b/include/defalloc.h
new file mode 100644
index 000000000..ef675d3a8
--- /dev/null
+++ b/include/defalloc.h
@@ -0,0 +1,39 @@
+/*************************************************
+* Basic Allocators Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_BASIC_ALLOC_H__
+#define BOTAN_BASIC_ALLOC_H__
+
+#include <botan/mem_pool.h>
+
+namespace Botan {
+
+/*************************************************
+* Malloc Allocator *
+*************************************************/
+class Malloc_Allocator : public Pooling_Allocator
+ {
+ public:
+ Malloc_Allocator() : Pooling_Allocator(64*1024, false) {}
+ private:
+ void* alloc_block(u32bit);
+ void dealloc_block(void*, u32bit);
+ };
+
+/*************************************************
+* Locking Allocator *
+*************************************************/
+class Locking_Allocator : public Pooling_Allocator
+ {
+ public:
+ Locking_Allocator() : Pooling_Allocator(64*1024, true) {}
+ private:
+ void* alloc_block(u32bit);
+ void dealloc_block(void*, u32bit);
+ };
+
+}
+
+#endif