From 89ae754db15c9e78ddd52cf7cd92caf253a2bd81 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 28 Aug 2015 19:50:57 -0400 Subject: Use 16 byte alignment for all allocations in the mlock allocator --- src/lib/alloc/locking_allocator/locking_allocator.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/alloc/locking_allocator/locking_allocator.cpp b/src/lib/alloc/locking_allocator/locking_allocator.cpp index ec294d8f0..c145cfd7f 100644 --- a/src/lib/alloc/locking_allocator/locking_allocator.cpp +++ b/src/lib/alloc/locking_allocator/locking_allocator.cpp @@ -18,12 +18,6 @@ namespace Botan { namespace { -/** -* Requests for objects of sizeof(T) will be aligned at -* sizeof(T)*ALIGNMENT_MULTIPLE bytes. -*/ -const size_t ALIGNMENT_MULTIPLE = 2; - size_t reset_mlock_limit(size_t max_req) { #if defined(RLIMIT_MEMLOCK) @@ -104,7 +98,7 @@ void* mlock_allocator::allocate(size_t num_elems, size_t elem_size) return nullptr; const size_t n = num_elems * elem_size; - const size_t alignment = ALIGNMENT_MULTIPLE * elem_size; + const size_t alignment = 16; if(n / elem_size != num_elems) return nullptr; // overflow! -- cgit v1.2.3