Unverified Commit 99d308ff authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #836 from pwrdwnsys/openbsd-aligned_alloc

Add OpenBSD to posix_memalign ifdef
parents c6d71669 73c5b9f7
...@@ -288,8 +288,8 @@ void BTreeImpl::growTree(uint minCapacity) { ...@@ -288,8 +288,8 @@ void BTreeImpl::growTree(uint minCapacity) {
// aligned_alloc() function. Unfortunately, many platforms don't implement it. Luckily, there // aligned_alloc() function. Unfortunately, many platforms don't implement it. Luckily, there
// are usually alternatives. // are usually alternatives.
#if __APPLE__ || __BIONIC__ #if __APPLE__ || __BIONIC__ || __OpenBSD__
// OSX and Android lack aligned_alloc(), but have posix_memalign(). Fine. // macOS, OpenBSD, and Android lack aligned_alloc(), but have posix_memalign(). Fine.
void* allocPtr; void* allocPtr;
int error = posix_memalign(&allocPtr, int error = posix_memalign(&allocPtr,
sizeof(BTreeImpl::NodeUnion), newCapacity * sizeof(BTreeImpl::NodeUnion)); sizeof(BTreeImpl::NodeUnion), newCapacity * sizeof(BTreeImpl::NodeUnion));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment