Classical memory allocation functions which generate a Lua error in case of problem.
void* luaT_alloc(lua_State *L, long size)
void* luaT_realloc(lua_State *L, void *ptr, long size)
void luaT_free(lua_State *L, void *ptr)