aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc/alloc_mmap/mmap_mem.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-30 04:46:32 +0000
committerlloyd <[email protected]>2008-09-30 04:46:32 +0000
commit42e3fe73cb63fe92510964d60bfccded65d08c36 (patch)
treefb77293dfc71b386da6da4fe0f92676b53afc02b /src/alloc/alloc_mmap/mmap_mem.h
parentbd2abf83b8ae1b93f2c8e1875873c1cab9c1e18e (diff)
Move allocator base code into core/, alloc_mmap to alloc/
Diffstat (limited to 'src/alloc/alloc_mmap/mmap_mem.h')
-rw-r--r--src/alloc/alloc_mmap/mmap_mem.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h
new file mode 100644
index 000000000..740aa9ec6
--- /dev/null
+++ b/src/alloc/alloc_mmap/mmap_mem.h
@@ -0,0 +1,28 @@
+/*************************************************
+* Memory Mapping Allocator Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_MMAP_ALLOCATOR_H__
+#define BOTAN_MMAP_ALLOCATOR_H__
+
+#include <botan/mem_pool.h>
+
+namespace Botan {
+
+/*************************************************
+* Memory Mapping Allocator *
+*************************************************/
+class MemoryMapping_Allocator : public Pooling_Allocator
+ {
+ public:
+ MemoryMapping_Allocator(Mutex* m) : Pooling_Allocator(m) {}
+ std::string type() const { return "mmap"; }
+ private:
+ void* alloc_block(u32bit);
+ void dealloc_block(void*, u32bit);
+ };
+
+}
+
+#endif