mirror of
https://github.com/lua/lua.git
synced 2025-02-04 06:13:04 +08:00
allocator function receives the tag of object being allocated in 'osize'
when 'ptr' is NULL.
This commit is contained in:
parent
9fbe0690fb
commit
2af0d3b459
5
lstate.c
5
lstate.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstate.c,v 2.64 2009/11/18 13:13:47 roberto Exp roberto $
|
** $Id: lstate.c,v 2.65 2009/12/14 15:27:30 roberto Exp roberto $
|
||||||
** Global State
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -192,8 +192,7 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
|
|||||||
lua_State *L1;
|
lua_State *L1;
|
||||||
lua_lock(L);
|
lua_lock(L);
|
||||||
luaC_checkGC(L);
|
luaC_checkGC(L);
|
||||||
L1 = &luaM_new(L, LX)->l;
|
L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th;
|
||||||
luaC_link(L, obj2gco(L1), LUA_TTHREAD);
|
|
||||||
setthvalue(L, L->top, L1);
|
setthvalue(L, L->top, L1);
|
||||||
api_incr_top(L);
|
api_incr_top(L);
|
||||||
preinit_state(L1, G(L));
|
preinit_state(L1, G(L));
|
||||||
|
5
ltests.h
5
ltests.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltests.h,v 2.26 2009/11/19 19:06:52 roberto Exp roberto $
|
** $Id: ltests.h,v 2.27 2009/12/14 15:27:30 roberto Exp roberto $
|
||||||
** Internal Header for Debugging of the Lua Implementation
|
** Internal Header for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -30,9 +30,10 @@ typedef struct Memcontrol {
|
|||||||
unsigned long total;
|
unsigned long total;
|
||||||
unsigned long maxmem;
|
unsigned long maxmem;
|
||||||
unsigned long memlimit;
|
unsigned long memlimit;
|
||||||
|
unsigned long objcount[5];
|
||||||
} Memcontrol;
|
} Memcontrol;
|
||||||
|
|
||||||
Memcontrol l_memcontrol;
|
extern Memcontrol l_memcontrol;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user