aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lstring.c b/lstring.c
index 638f3dec..5af5050b 100644
--- a/lstring.c
+++ b/lstring.c
@@ -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*/
94void 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*/
93void luaS_init (lua_State *L) { 106void luaS_init (lua_State *L) {