diff options
Diffstat (limited to 'src/allocate.cpp')
-rw-r--r-- | src/allocate.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/allocate.cpp b/src/allocate.cpp new file mode 100644 index 000000000..62b201249 --- /dev/null +++ b/src/allocate.cpp @@ -0,0 +1,25 @@ +/************************************************* +* Allocator Factory Source File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#include <botan/allocate.h> +#include <botan/libstate.h> +#include <botan/mutex.h> +#include <map> + +namespace Botan { + +/************************************************* +* Get an allocator * +*************************************************/ +Allocator* get_allocator(const std::string& type) + { + Allocator* alloc = global_state().get_allocator(type); + if(alloc) + return alloc; + + throw Exception("Couldn't find an allocator to use in get_allocator"); + } + +} |