aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-05 18:15:18 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-05 18:15:18 -0200
commit592a309177edc52847b1196969ad6d49ba21f4fb (patch)
tree06add977885c012ee22cc4f105785c435b6af353 /lstring.c
parent413fc7334bf8ceaea71417d73edef15c99d3a793 (diff)
downloadlua-592a309177edc52847b1196969ad6d49ba21f4fb.tar.gz
lua-592a309177edc52847b1196969ad6d49ba21f4fb.tar.bz2
lua-592a309177edc52847b1196969ad6d49ba21f4fb.zip
tag system replaced by event tables
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lstring.c b/lstring.c
index 5f69aafc..d12b6f0f 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 1.67 2001/08/31 19:46:07 roberto Exp $ 2** $Id: lstring.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -84,9 +84,11 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
84 84
85 85
86Udata *luaS_newudata (lua_State *L, size_t s) { 86Udata *luaS_newudata (lua_State *L, size_t s) {
87 Udata *u = cast(Udata *, luaM_malloc(L, sizeudata(s))); 87 Udata *u;
88 if (s & 1) s++; /* make sure size is even */
89 u = cast(Udata *, luaM_malloc(L, sizeudata(s)));
88 u->uv.len = s; 90 u->uv.len = s;
89 u->uv.tag = 0; 91 u->uv.eventtable = hvalue(defaultet(L));
90 u->uv.value = u + 1; 92 u->uv.value = u + 1;
91 /* chain it on udata list */ 93 /* chain it on udata list */
92 u->uv.next = G(L)->rootudata; 94 u->uv.next = G(L)->rootudata;