Function aalloc

Synopsis

#include <src/c4/memory_resource.hpp>

void * aalloc(size_t sz, size_t alignment)

Description

c-style allocation

this API provides aligned allocation functions. These functions forward the call to a user-modifiable function. aligned allocation. Aligned allocation. Merely calls the current get_aalloc() function.

See
get_aalloc()

Mentioned in

Source

Lines 135-141 in src/c4/memory_resource.cpp. Line 42 in src/c4/memory_resource.hpp.

void* aalloc(size_t sz, size_t alignment)
{
    C4_ASSERT_MSG(c4::get_aalloc() != nullptr, "did you forget to call set_aalloc()?");
    auto fn = c4::get_aalloc();
    void* ptr = fn(sz, alignment);
    return ptr;
}





Add Discussion as Guest

Log in