diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/libstate.cpp | 2 | ||||
-rw-r--r-- | src/core/modules.cpp | 6 | ||||
-rw-r--r-- | src/core/modules.h | 7 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/core/libstate.cpp b/src/core/libstate.cpp index df9d2b519..60bb24fee 100644 --- a/src/core/libstate.cpp +++ b/src/core/libstate.cpp @@ -239,7 +239,7 @@ void Library_State::initialize(const InitializerOptions& args, cached_default_allocator = 0; - std::vector<Allocator*> mod_allocs = modules.allocators(); + std::vector<Allocator*> mod_allocs = modules.allocators(mutex_factory); for(u32bit j = 0; j != mod_allocs.size(); ++j) add_allocator(mod_allocs[j]); diff --git a/src/core/modules.cpp b/src/core/modules.cpp index 08ab0cdbb..08553bf00 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -61,15 +61,15 @@ Mutex_Factory* Builtin_Modules::mutex_factory(bool thread_safe) const /************************************************* * Find any usable allocators * *************************************************/ -std::vector<Allocator*> Builtin_Modules::allocators() const +std::vector<Allocator*> Builtin_Modules::allocators(Mutex_Factory* mf) const { std::vector<Allocator*> allocators; #if defined(BOTAN_HAS_ALLOC_MMAP) - allocators.push_back(new MemoryMapping_Allocator); + allocators.push_back(new MemoryMapping_Allocator(mf->make())); #endif - allocators.push_back(new Locking_Allocator); + allocators.push_back(new Locking_Allocator(mf->make())); allocators.push_back(new Malloc_Allocator); return allocators; diff --git a/src/core/modules.h b/src/core/modules.h index 69a6e1ffb..abbfbb2c6 100644 --- a/src/core/modules.h +++ b/src/core/modules.h @@ -7,6 +7,7 @@ #define BOTAN_MODULE_FACTORIES_H__ #include <botan/init.h> +#include <botan/mutex.h> #include <string> #include <vector> @@ -22,7 +23,9 @@ class BOTAN_DLL Modules virtual std::string default_allocator() const = 0; - virtual std::vector<class Allocator*> allocators() const = 0; + virtual std::vector<class Allocator*> + allocators(Mutex_Factory*) const = 0; + virtual std::vector<class Engine*> engines() const = 0; virtual ~Modules() {} @@ -38,7 +41,7 @@ class BOTAN_DLL Builtin_Modules : public Modules std::string default_allocator() const; - std::vector<class Allocator*> allocators() const; + std::vector<class Allocator*> allocators(Mutex_Factory*) const; std::vector<class Engine*> engines() const; Builtin_Modules(const InitializerOptions&); |