std1.0.0-beta-7 SafeC docs

std :: alloc::allocator

Function std::alloc_t

#include <std/alloc/allocator.h> source

generic<T, A: Allocate> ?&heap T alloc_t(&A a)

One T / n Ts, aligned for T; null when the allocator can't. The memory is uninitialised. T is inferred from the target ('?&heap Packet p = alloc_t(&pool);'). alloc_array_t aborts with a diagnostic if n * sizeof(T) overflows (checked_mul_size).