diff options
Diffstat (limited to 'lstring.c')
| -rw-r--r-- | lstring.c | 15 |
1 files changed, 14 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstring.c,v 2.46 2015/01/16 16:54:37 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.47 2015/03/04 13:31:21 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 | */ |
| @@ -88,6 +88,19 @@ void luaS_resize (lua_State *L, int newsize) { | |||
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | /* | 90 | /* |
| 91 | ** Clear API string cache. (Entries cannot be empty, so fill them with | ||
| 92 | ** a non-collectable string.) | ||
| 93 | */ | ||
| 94 | void luaS_clearcache (global_State *g) { | ||
| 95 | int i; | ||
| 96 | for (i = 0; i < STRCACHE_SIZE; i++) { | ||
| 97 | if (iswhite(g->strcache[i])) /* will entry be collected? */ | ||
| 98 | g->strcache[i] = g->memerrmsg; /* replace it with something fixed */ | ||
| 99 | } | ||
| 100 | } | ||
| 101 | |||
| 102 | |||
| 103 | /* | ||
| 91 | ** Initialize the string table and the string cache | 104 | ** Initialize the string table and the string cache |
| 92 | */ | 105 | */ |
| 93 | void luaS_init (lua_State *L) { | 106 | void luaS_init (lua_State *L) { |
