new function 'lua_setallocf'

This commit is contained in:
Roberto Ierusalimschy
2005-09-20 14:55:10 -03:00
parent bf96d3fdd9
commit d8f1cca16e
3 changed files with 18 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 2.30 2005/08/26 17:36:32 roberto Exp roberto $
** $Id: ltests.c,v 2.31 2005/09/14 17:48:57 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -1124,6 +1124,7 @@ int luaB_opentests (lua_State *L) {
void *ud;
lua_assert(lua_getallocf(L, &ud) == debug_realloc);
lua_assert(ud == cast(void *, &memcontrol));
lua_setallocf(L, lua_getallocf(L, NULL), ud);
lua_state = L; /* keep first state to be opened */
luaL_register(L, "T", tests_funcs);
return 0;