diff options
author | Jack Lloyd <[email protected]> | 2015-08-28 19:50:57 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-08-28 19:50:57 -0400 |
commit | 89ae754db15c9e78ddd52cf7cd92caf253a2bd81 (patch) | |
tree | 35f74e2e7ccf4d426a3020eb466fc062f059bff1 /src | |
parent | 9c3d1e61185768a5a2b184b0705ff46b41fe255c (diff) |
Use 16 byte alignment for all allocations in the mlock allocator
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/alloc/locking_allocator/locking_allocator.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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! |