TODO - Need to understand why on Linux sometimes calling aligned_alloc causes corruption
| 78 | #else |
| 79 | // TODO - Need to understand why on Linux sometimes calling aligned_alloc causes corruption |
| 80 | void* vvl_aligned_malloc(std::size_t size, std::size_t al) { |
| 81 | void* mem = malloc(size + al + sizeof(void*)); |
| 82 | void** ptr = (void**)((uintptr_t)((uintptr_t)mem + al + sizeof(void*)) & ~(al - 1)); |
| 83 | ptr[-1] = mem; |
| 84 | return ptr; |
| 85 | } |
| 86 | |
| 87 | void vvl_aligned_free(void* ptr) { free(((void**)ptr)[-1]); } |
| 88 | #endif |
no outgoing calls
no test coverage detected