19 if (ptr) ::memset(ptr, 0, bytes);
25 if (alignment != 0 && (
size % alignment) != 0)
26 size = ((
size / alignment) + 1) * alignment;
28 return _aligned_malloc(
size, alignment);
31 if (::posix_memalign(&p, alignment,
size) != 0)
37 return ::aligned_alloc(alignment,
size);
43 return _aligned_free(ptr);
51 if ((
size % alignment) != 0)
size = ((
size / alignment) + 1) * alignment;
53 return _aligned_realloc(ptr,
size, alignment);
55 return std::realloc(ptr,
size);
void aligned_free(void *ptr)
size_t size(const MATRIXLIKE &m, const int dim)
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.