From 6baa9c20eb3f4d6ff81b357ff3d5760a7daaad41 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 19 Feb 2018 11:40:23 -0500 Subject: Move allocator initializer RAII class to mem_ops.h May be needed elsewhere --- src/lib/pubkey/ec_group/ec_group.cpp | 5 ----- src/lib/utils/mem_ops.h | 6 ++++++ 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 -- cgit v1.2.3