diff --git a/lstring.c b/lstring.c index 4643f214..a1ec6b80 100644 --- a/lstring.c +++ b/lstring.c @@ -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) ** 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 *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->uv.len = s; u->uv.metatable = hvalue(defaultmeta(L));