1#ifndef NNGN_UTILS_ALLOC_REALLOC_H
2#define NNGN_UTILS_ALLOC_REALLOC_H
18template<trivial T =
char>
21 using pointer = std::add_pointer_t<value_type>;
29 return static_cast<pointer>(malloc(
n *
sizeof(
T)));
34 return static_cast<pointer>(realloc(p,
n *
sizeof(
T)));
Definition fundamental.h:41
local n
Definition dump_lights.lua:5
Base class for allocators, implements a few basic operations.
Definition base.h:49
Simple allocator which supports reallocation.
Definition realloc.h:19
pointer reallocate(pointer p, std::size_t n) noexcept
Definition realloc.h:33
void deallocate(pointer p, std::size_t) noexcept
Definition realloc.h:24
pointer allocate(std::size_t n) noexcept
Definition realloc.h:28
T value_type
Definition realloc.h:20