diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-29 17:34:02 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-29 17:34:02 -0200 |
commit | 63a822c8e199918c54e325cbc8696ed04071aba8 (patch) | |
tree | 430e1b2fe1ffafb712bd712b5b625a18afaa953d /lstring.c | |
parent | 09def5da4440a5a91c2721f495bd9c3df1081874 (diff) | |
download | lua-63a822c8e199918c54e325cbc8696ed04071aba8.tar.gz lua-63a822c8e199918c54e325cbc8696ed04071aba8.tar.bz2 lua-63a822c8e199918c54e325cbc8696ed04071aba8.zip |
all boxed types start with their tags
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.51 2001/01/19 13:20:30 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.52 2001/01/26 15:58:50 roberto Exp roberto $ |
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 | */ |
@@ -76,6 +76,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
76 | } | 76 | } |
77 | /* not found */ | 77 | /* not found */ |
78 | ts = (TString *)luaM_malloc(L, sizestring(l)); | 78 | ts = (TString *)luaM_malloc(L, sizestring(l)); |
79 | ts->v.ttype = LUA_TSTRING; | ||
79 | ts->marked = 0; | 80 | ts->marked = 0; |
80 | ts->nexthash = NULL; | 81 | ts->nexthash = NULL; |
81 | ts->len = l; | 82 | ts->len = l; |
@@ -91,6 +92,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
91 | TString *luaS_newudata (lua_State *L, size_t s, void *udata) { | 92 | TString *luaS_newudata (lua_State *L, size_t s, void *udata) { |
92 | union L_UTString *uts = (union L_UTString *)luaM_malloc(L, sizeudata(s)); | 93 | union L_UTString *uts = (union L_UTString *)luaM_malloc(L, sizeudata(s)); |
93 | TString *ts = &uts->ts; | 94 | TString *ts = &uts->ts; |
95 | ts->v.ttype = LUA_TUSERDATA; | ||
94 | ts->marked = 0; | 96 | ts->marked = 0; |
95 | ts->nexthash = NULL; | 97 | ts->nexthash = NULL; |
96 | ts->len = s; | 98 | ts->len = s; |