Also use posix_memalign() on NetBSD
This helps fix the build on this platform.
This commit is contained in:
parent
80bbafecfc
commit
c02d36a2f7
@ -146,7 +146,7 @@ bitslice_test_nonces_t bitslice_test_nonces_dispatch;
|
||||
#if defined (_WIN32)
|
||||
#define malloc_bitslice(x) __builtin_assume_aligned(_aligned_malloc((x), MAX_BITSLICES/8), MAX_BITSLICES/8)
|
||||
#define free_bitslice(x) _aligned_free(x)
|
||||
#elif defined (__APPLE__)
|
||||
#elif defined (__APPLE__) || defined(__NetBSD__)
|
||||
static void *malloc_bitslice(size_t x) {
|
||||
char *allocated_memory;
|
||||
if (posix_memalign((void**)&allocated_memory, MAX_BITSLICES/8, x)) {
|
||||
|
||||
@ -147,7 +147,7 @@ inline uint32_t *MALLOC_BITARRAY(uint32_t x)
|
||||
{
|
||||
#if defined (_WIN32)
|
||||
return __builtin_assume_aligned(_aligned_malloc((x), __BIGGEST_ALIGNMENT__), __BIGGEST_ALIGNMENT__);
|
||||
#elif defined (__APPLE__)
|
||||
#elif defined (__APPLE__) || defined(__NetBSD__)
|
||||
uint32_t *allocated_memory;
|
||||
if (posix_memalign((void**)&allocated_memory, __BIGGEST_ALIGNMENT__, x)) {
|
||||
return NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user