reserve one more bit for GC
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstring.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
|
** $Id: lstring.c,v 1.72 2002/02/08 22:41:09 roberto Exp roberto $
|
||||||
** String table (keeps all strings handled by Lua)
|
** String table (keeps all strings handled by Lua)
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -85,7 +85,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
|
|||||||
|
|
||||||
Udata *luaS_newudata (lua_State *L, size_t s) {
|
Udata *luaS_newudata (lua_State *L, size_t s) {
|
||||||
Udata *u;
|
Udata *u;
|
||||||
if (s & 1) s++; /* make sure size is even */
|
s = (s+3) & (~(size_t)3); /* make sure size is multiple of 4 */
|
||||||
u = cast(Udata *, luaM_malloc(L, sizeudata(s)));
|
u = cast(Udata *, luaM_malloc(L, sizeudata(s)));
|
||||||
u->uv.len = s;
|
u->uv.len = s;
|
||||||
u->uv.metatable = hvalue(defaultmeta(L));
|
u->uv.metatable = hvalue(defaultmeta(L));
|
||||||
|
|||||||
Reference in New Issue
Block a user