summaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 11:46:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 11:46:47 -0300
commitbb129031205acc64eb6b41c98d8a08c1fccce308 (patch)
tree65e01a5af21d2867c3108507ed0afbb8d32201bd /lstring.c
parentca41b43f53562e64abe433d6346d174c92548603 (diff)
downloadlua-github-bb129031205acc64eb6b41c98d8a08c1fccce308.tar.gz
type 'Udata' refers directly to structure inside the union (union
used only for aligning purposes now)
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lstring.c b/lstring.c
index fdd76300..cb8d1e2a 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.c,v 2.41 2014/07/18 12:17:54 roberto Exp roberto $
+** $Id: lstring.c,v 2.42 2014/07/18 13:36:14 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -170,10 +170,10 @@ Udata *luaS_newudata (lua_State *L, size_t s) {
GCObject *o;
if (s > MAX_SIZE - sizeof(Udata))
luaM_toobig(L);
- o = luaC_newobj(L, LUA_TUSERDATA, sizeof(Udata) + s);
- u = rawgco2u(o);
- u->uv.len = s;
- u->uv.metatable = NULL;
+ o = luaC_newobj(L, LUA_TUSERDATA, sizeludata(s));
+ u = gco2u(o);
+ u->len = s;
+ u->metatable = NULL;
setuservalue(L, u, luaO_nilobject);
return u;
}