pitrou commented on a change in pull request #9694: URL: https://github.com/apache/arrow/pull/9694#discussion_r593781841
########## File path: cpp/src/arrow/memory_pool.cc ########## @@ -182,6 +182,12 @@ class SystemAllocator { if (!*out) { return Status::OutOfMemory("malloc of size ", size, " failed"); } +#elif defined(sun) || defined(__sun) +#include <stdlib.h> + *out = reinterpret_cast<uint8_t*>(memalign(static_cast<size_t>(size), kAlignment)); Review comment: The [signature](https://docs.oracle.com/cd/E36784_01/html/E36874/memalign-3c.html) is `void *memalign(size_t alignment, size_t size)`, so you've got the arguments flipped (did you run the tests?). ########## File path: cpp/src/arrow/memory_pool.cc ########## @@ -182,6 +182,12 @@ class SystemAllocator { if (!*out) { return Status::OutOfMemory("malloc of size ", size, " failed"); } +#elif defined(sun) || defined(__sun) +#include <stdlib.h> Review comment: Can you move the `#include` at the top of the file? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org