diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /include/defalloc.h |
Initial checkin1.5.6
Diffstat (limited to 'include/defalloc.h')
-rw-r--r-- | include/defalloc.h | 39 |
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 |