aboutsummaryrefslogtreecommitdiffstats
path: root/src/allocate.cpp
blob: 62b2012494d2ba0203b7db49e7c60e1082909f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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");
   }

}