aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/mem_ops.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-04 15:27:40 -0500
committerJack Lloyd <[email protected]>2018-02-04 15:27:40 -0500
commit2cb0fa04472f4bc60f02d822daa8f4f8ad487e7e (patch)
treedc48529923d296a06b44b9730bd535f63efe16d9 /src/lib/utils/mem_ops.cpp
parenta17f1b71254e7e4c9de1a86a246fb85a3a4f25b9 (diff)
Alternate method of forcing allocator initialization
That doesn't require a malloc/free every time we call ec_group_data()
Diffstat (limited to 'src/lib/utils/mem_ops.cpp')
-rw-r--r--src/lib/utils/mem_ops.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/utils/mem_ops.cpp b/src/lib/utils/mem_ops.cpp
index 3fd463195..b7ecd5326 100644
--- a/src/lib/utils/mem_ops.cpp
+++ b/src/lib/utils/mem_ops.cpp
@@ -41,6 +41,13 @@ void deallocate_memory(void* p, size_t elems, size_t elem_size)
std::free(p);
}
+void initialize_allocator()
+ {
+#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
+ mlock_allocator::instance();
+#endif
+ }
+
bool constant_time_compare(const uint8_t x[],
const uint8_t y[],
size_t len)