18 if (ptr) ::memset(ptr, 0, bytes);
24 if ((
size % alignment) != 0)
size = ((
size / alignment) + 1) * alignment;
26 return _aligned_malloc(
size, alignment);
28 return ::aligned_alloc(alignment,
size);
34 return _aligned_free(ptr);
42 if ((
size % alignment) != 0)
size = ((
size / alignment) + 1) * alignment;
44 return _aligned_realloc(ptr,
size, alignment);
46 return std::realloc(ptr,
size);
void aligned_free(void *ptr)
void * aligned_malloc(size_t size, size_t alignment)
void * aligned_realloc(void *ptr, size_t size, size_t alignment)
void * aligned_calloc(size_t bytes, size_t alignment)
Identical to aligned_malloc, but it zeroes the reserved memory block.