MCPcopy Create free account
hub / github.com/Amanieu/asyncplusplus / aligned_alloc

Function aligned_alloc

src/scheduler.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace detail {
30
31void* aligned_alloc(std::size_t size, std::size_t align)
32{
33#ifdef _WIN32
34 void* ptr = _aligned_malloc(size, align);
35 if (!ptr)
36 LIBASYNC_THROW(std::bad_alloc());
37 return ptr;
38#else
39 void* result;
40 if (posix_memalign(&result, align, size))
41 LIBASYNC_THROW(std::bad_alloc());
42 else
43 return result;
44#endif
45}
46
47void aligned_free(void* addr) LIBASYNC_NOEXCEPT
48{

Callers 2

operator newFunction · 0.85
aligned_alloc.hFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected