MCPcopy Create free account
hub / github.com/aseprite/laf / base_aligned_alloc

Function base_aligned_alloc

base/memory.cpp:306–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304#endif
305
306void* base_aligned_alloc(std::size_t bytes, std::size_t alignment)
307{
308#if LAF_WINDOWS
309 return _aligned_malloc(bytes, alignment);
310#else
311 ASSERT(alignment > 0);
312 std::size_t misaligned = (bytes % alignment);
313 if (misaligned > 0)
314 bytes += alignment - misaligned;
315 return aligned_alloc(alignment, bytes);
316#endif
317}
318
319void base_aligned_free(void* mem)
320{

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68