mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-03-04 19:29:35 +00:00
Fix AIX AlignedAllocate
Well, the IBM docs were not quite correct when they stated "The block is aligned so that it can be used for any type of data". The vector data types are pretty standard, even across different machines from diffent manufacturers
This commit is contained in:
parent
58f6b7695b
commit
aee296d663
4
config.h
4
config.h
@ -695,7 +695,9 @@ NAMESPACE_END
|
||||
#define CRYPTOPP_MM_MALLOC_AVAILABLE
|
||||
#elif defined(__APPLE__)
|
||||
#define CRYPTOPP_APPLE_MALLOC_AVAILABLE
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(_AIX)
|
||||
#elif defined(_AIX)
|
||||
#define CRYPTOPP_POSIX_MEMALIGN_AVAILABLE
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
|
||||
#elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
|
||||
#define CRYPTOPP_MEMALIGN_AVAILABLE
|
||||
|
6
misc.cpp
6
misc.cpp
@ -22,6 +22,10 @@
|
||||
#if defined(CRYPTOPP_MEMALIGN_AVAILABLE) || defined(CRYPTOPP_MM_MALLOC_AVAILABLE) || defined(QNX)
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
// for posix_memalign
|
||||
#if defined(CRYPTOPP_POSIX_MEMALIGN_AVAILABLE)
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
@ -285,6 +289,8 @@ void * AlignedAllocate(size_t size)
|
||||
while ((p = (byte *)malloc(size)) == NULLPTR)
|
||||
#elif defined(CRYPTOPP_MM_MALLOC_AVAILABLE)
|
||||
while ((p = (byte *)_mm_malloc(size, 16)) == NULLPTR)
|
||||
#elif defined(CRYPTOPP_POSIX_MEMALIGN_AVAILABLE)
|
||||
while (posix_memalign(reinterpret_cast<void**>(&p), 16, size) != 0)
|
||||
#elif defined(CRYPTOPP_MEMALIGN_AVAILABLE)
|
||||
while ((p = (byte *)memalign(16, size)) == NULLPTR)
|
||||
#elif defined(CRYPTOPP_MALLOC_ALIGNMENT_IS_16)
|
||||
|
Loading…
x
Reference in New Issue
Block a user