| 25 | #endif |
| 26 | |
| 27 | void* aligned_malloc(size_t size, size_t alignment) |
| 28 | { |
| 29 | #if defined(_win_) |
| 30 | return _aligned_malloc(size, alignment); |
| 31 | #elif defined(_darwin_) || defined(_linux_) || defined(__FreeBSD__) |
| 32 | void* ptr = nullptr; |
| 33 | ::posix_memalign(&ptr, alignment, size); |
| 34 | return ptr; |
| 35 | #else |
| 36 | # error Unsupported platform |
| 37 | #endif |
| 38 | } |
| 39 | |
| 40 | //////////////////////////////////////////////////////////////////////////////// |
no test coverage detected