all boxed types start with their tags

This commit is contained in:
Roberto Ierusalimschy
2001-01-29 17:34:02 -02:00
parent 09def5da44
commit 63a822c8e1
7 changed files with 36 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstring.c,v 1.51 2001/01/19 13:20:30 roberto Exp roberto $
** $Id: lstring.c,v 1.52 2001/01/26 15:58:50 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -76,6 +76,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
}
/* not found */
ts = (TString *)luaM_malloc(L, sizestring(l));
ts->v.ttype = LUA_TSTRING;
ts->marked = 0;
ts->nexthash = NULL;
ts->len = l;
@@ -91,6 +92,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
TString *luaS_newudata (lua_State *L, size_t s, void *udata) {
union L_UTString *uts = (union L_UTString *)luaM_malloc(L, sizeudata(s));
TString *ts = &uts->ts;
ts->v.ttype = LUA_TUSERDATA;
ts->marked = 0;
ts->nexthash = NULL;
ts->len = s;