diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-30 10:01:48 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-30 10:01:48 -0300 |
commit | ab52fc6097569cf51bc0c55dd5b6b1329eefd970 (patch) | |
tree | 776f1c7b8b42d519aef011edb0ea9e439d10325d | |
parent | e68d0df1c6144551eedda90e0a99d850b1461df1 (diff) | |
download | lua-ab52fc6097569cf51bc0c55dd5b6b1329eefd970.tar.gz lua-ab52fc6097569cf51bc0c55dd5b6b1329eefd970.tar.bz2 lua-ab52fc6097569cf51bc0c55dd5b6b1329eefd970.zip |
new macro to `fix' strings
-rw-r--r-- | lstring.h | 4 | ||||
-rw-r--r-- | ltm.c | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.h,v 1.34 2001/08/31 19:46:07 roberto Exp $ | 2 | ** $Id: lstring.h,v 1.35 2001/11/28 20:13:13 roberto Exp roberto $ |
3 | ** String table (keep all strings handled by Lua) | 3 | ** String table (keep all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -30,6 +30,8 @@ | |||
30 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ | 30 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ |
31 | (sizeof(s)/sizeof(char))-1)) | 31 | (sizeof(s)/sizeof(char))-1)) |
32 | 32 | ||
33 | #define luaS_fix(s) ((s)->tsv.marked = FIXMARK) | ||
34 | |||
33 | void luaS_resize (lua_State *L, int newsize); | 35 | void luaS_resize (lua_State *L, int newsize); |
34 | Udata *luaS_newudata (lua_State *L, size_t s); | 36 | Udata *luaS_newudata (lua_State *L, size_t s); |
35 | void luaS_freeall (lua_State *L); | 37 | void luaS_freeall (lua_State *L); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 1.88 2002/03/18 20:24:14 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.89 2002/04/05 18:54:31 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -35,7 +35,7 @@ void luaT_init (lua_State *L) { | |||
35 | int i; | 35 | int i; |
36 | for (i=0; i<TM_N; i++) { | 36 | for (i=0; i<TM_N; i++) { |
37 | G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); | 37 | G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); |
38 | G(L)->tmname[i]->tsv.marked = FIXMARK; /* never collect these names */ | 38 | luaS_fix(G(L)->tmname[i]); /* never collect these names */ |
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||