diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-08-23 07:08:34 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-08-23 07:08:34 -0400 |
commit | e054d36dc88d004efb16f6afe1234b4ea94f995c (patch) | |
tree | 7256575372e1b5d5606dc5a2ab6d3927c9e6dd65 /config.h | |
parent | 8382b49a1ff02694cb92c242d2a85acd878b1d6d (diff) | |
download | cryptopp-git-e054d36dc88d004efb16f6afe1234b4ea94f995c.tar.gz |
Add partial specializations for FixedSizeAllocatorWithCleanup
This allocator still has some demons buried inside due to the bit fiddling. This commit should isolate the demons to aligned stack allocations when an alignment facility from the platform or OS is not available. That is, we use CRYPTOPP_ALIGN_DATA when we can because it is most reliable.
We can tell when things have gone sideways using Debug builds. The CRYPTOPP_ASSERT(m_allocated) will fire on destruction because the flag gets overwritten.
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -346,10 +346,13 @@ NAMESPACE_END // CRYPTOPP_ALIGN_DATA may not be reliable on AIX.
#ifndef CRYPTOPP_ALIGN_DATA
#if defined(_MSC_VER)
+ #define CRYPTOPP_ALIGN_ATTRIBUTE 1
#define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
#elif defined(__GNUC__) || (__SUNPRO_CC >= 0x5100)
+ #define CRYPTOPP_ALIGN_ATTRIBUTE 1
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#elif defined(__xlc__) || defined(__xlC__)
+ #define CRYPTOPP_ALIGN_ATTRIBUTE 1
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#else
#define CRYPTOPP_ALIGN_DATA(x)
|