aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-19 11:40:23 -0500
committerJack Lloyd <[email protected]>2018-02-19 11:40:23 -0500
commit6baa9c20eb3f4d6ff81b357ff3d5760a7daaad41 (patch)
treed35c63f7e22bbc101918422830456acc0227ec4e
parent9792c0eb8203a4982d28afebb19b027444753f90 (diff)
Move allocator initializer RAII class to mem_ops.h
May be needed elsewhere
-rw-r--r--src/lib/pubkey/ec_group/ec_group.cpp5
-rw-r--r--src/lib/utils/mem_ops.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp
index 4123994b5..771bd4b0f 100644
--- a/src/lib/pubkey/ec_group/ec_group.cpp
+++ b/src/lib/pubkey/ec_group/ec_group.cpp
@@ -188,11 +188,6 @@ EC_Group_Data_Map& EC_Group::ec_group_data()
* This exists purely to ensure the allocator is constructed before g_ec_data,
* which ensures that its destructor runs after ~g_ec_data is complete.
*/
- class Allocator_Initializer
- {
- public:
- Allocator_Initializer() { initialize_allocator(); }
- };
static Allocator_Initializer g_init_allocator;
static EC_Group_Data_Map g_ec_data;
diff --git a/src/lib/utils/mem_ops.h b/src/lib/utils/mem_ops.h
index 5fb5752fc..c59c02d5a 100644
--- a/src/lib/utils/mem_ops.h
+++ b/src/lib/utils/mem_ops.h
@@ -37,6 +37,12 @@ BOTAN_PUBLIC_API(2,3) void deallocate_memory(void* p, size_t elems, size_t elem_
*/
void initialize_allocator();
+class Allocator_Initializer
+ {
+ public:
+ Allocator_Initializer() { initialize_allocator(); }
+ };
+
/**
* Scrub memory contents in a way that a compiler should not elide,
* using some system specific technique. Note that this function might