1#ifndef NNGN_LUA_ALLOC_H
2#define NNGN_LUA_ALLOC_H
31 static void *
lua_alloc(
void *d,
void *p, std::size_t s0, std::size_t s1);
33 static constexpr std::array
types = {
41 static constexpr auto n_types = 1 + std::tuple_size_v<
decltype(
types)>;
52 std::array<info, n_types>
v = {};
Definition lua_audio.cpp:19
constexpr auto to_underlying(T t)
Definition utils.h:138
constexpr bool is_sequence(R &&r, Proj proj={})
Definition ranges.h:119
Allocation information for each type.
Definition alloc.h:47
std::size_t bytes
Definition alloc.h:47
std::size_t n
Definition alloc.h:47
Tracks state allocations.
Definition alloc.h:29
static constexpr auto n_types
Number of types for which allocations are tracked.
Definition alloc.h:41
static constexpr std::array types
Each entry corresponds to the allocation information in v.
Definition alloc.h:33
std::array< info, n_types > v
Total size in bytes of active allocations for each type.
Definition alloc.h:52
static void * lua_alloc(void *d, void *p, std::size_t s0, std::size_t s1)
Function to be passed to lua_newstate.
Definition alloc.cpp:102