diff options
-rw-r--r-- | include/defalloc.h | 11 | ||||
-rw-r--r-- | src/defalloc.cpp | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/defalloc.h b/include/defalloc.h index 184378d84..afdb95edd 100644 --- a/include/defalloc.h +++ b/include/defalloc.h @@ -13,14 +13,15 @@ namespace Botan { /************************************************* * Malloc Allocator * *************************************************/ -class Malloc_Allocator : public Pooling_Allocator +class Malloc_Allocator : public Allocator { public: - Malloc_Allocator() : Pooling_Allocator(64*1024, false) {} + void* allocate(u32bit); + void deallocate(void*, u32bit); + std::string type() const { return "malloc"; } - private: - void* alloc_block(u32bit); - void dealloc_block(void*, u32bit); + + Malloc_Allocator(); }; /************************************************* diff --git a/src/defalloc.cpp b/src/defalloc.cpp index a4a4727af..f7d880cda 100644 --- a/src/defalloc.cpp +++ b/src/defalloc.cpp @@ -50,7 +50,7 @@ void do_free(void* ptr, u32bit n, bool do_lock) /************************************************* * Malloc_Allocator's Allocation * *************************************************/ -void* Malloc_Allocator::alloc_block(u32bit n) +void* Malloc_Allocator::allocate(u32bit n) { return do_malloc(n, false); } @@ -58,7 +58,7 @@ void* Malloc_Allocator::alloc_block(u32bit n) /************************************************* * Malloc_Allocator's Deallocation * *************************************************/ -void Malloc_Allocator::dealloc_block(void* ptr, u32bit n) +void Malloc_Allocator::deallocate(void* ptr, u32bit n) { do_free(ptr, n, false); } |