1 // Copyright (C) 2018 Intel Corporation
3 // SPDX-License-Identifier: Apache-2.0
6 #include <memory/alloc.hpp>
13 void * memalign(size_t alignment, size_t size) {
15 posix_memalign(&buffer, alignment, size);
20 #include <util/math.hpp>
21 #include <util/assert.hpp>
26 void* aligned_alloc(std::size_t size, std::size_t alignment)
28 ASSERT(util::is_pow2(alignment));
30 return _aligned_malloc(size, alignment);
32 return memalign(alignment, size);
36 void aligned_free(void* ptr)
39 return _aligned_free(ptr);