diff options
author | Jack Lloyd <[email protected]> | 2017-09-29 19:15:48 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-29 21:05:29 -0400 |
commit | 2edb12e249387a72b24f5f34efae4735d589af9f (patch) | |
tree | d2873f1f3d608c0d23869893c22a69b05489ce48 /src/lib/utils/locking_allocator | |
parent | 184ce9f93906241d1807f73c7ea20283fc6ff222 (diff) |
In secure_allocator, hide mlock/new usage in a function in mem_ops
Switch to calloc/free instead of new/delete - shouldn't matter since
we are only allocate integral types.
This change reduces the size of libbotan-2.so by ~300 Kb on my system.
Diffstat (limited to 'src/lib/utils/locking_allocator')
-rw-r--r-- | src/lib/utils/locking_allocator/locking_allocator.cpp | 2 | ||||
-rw-r--r-- | src/lib/utils/locking_allocator/locking_allocator.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/utils/locking_allocator/locking_allocator.cpp b/src/lib/utils/locking_allocator/locking_allocator.cpp index 880f3add8..f36fa9130 100644 --- a/src/lib/utils/locking_allocator/locking_allocator.cpp +++ b/src/lib/utils/locking_allocator/locking_allocator.cpp @@ -116,7 +116,7 @@ void* mlock_allocator::allocate(size_t num_elems, size_t elem_size) return nullptr; } -bool mlock_allocator::deallocate(void* p, size_t num_elems, size_t elem_size) +bool mlock_allocator::deallocate(void* p, size_t num_elems, size_t elem_size) BOTAN_NOEXCEPT { if(!m_pool) return false; diff --git a/src/lib/utils/locking_allocator/locking_allocator.h b/src/lib/utils/locking_allocator/locking_allocator.h index 8e38129e2..e9299c120 100644 --- a/src/lib/utils/locking_allocator/locking_allocator.h +++ b/src/lib/utils/locking_allocator/locking_allocator.h @@ -21,7 +21,7 @@ class BOTAN_PUBLIC_API(2,0) mlock_allocator final void* allocate(size_t num_elems, size_t elem_size); - bool deallocate(void* p, size_t num_elems, size_t elem_size); + bool deallocate(void* p, size_t num_elems, size_t elem_size) BOTAN_NOEXCEPT; mlock_allocator(const mlock_allocator&) = delete; |