summaryrefslogtreecommitdiff
path: root/src/lj_gc.c
diff options
context:
space:
mode:
authorMike Pall <mike>2013-02-27 17:11:31 +0100
committerMike Pall <mike>2013-02-27 17:29:35 +0100
commit28cfcf77445e144335961a020e3e08d84cf0091f (patch)
tree1a769d0ee0fab26a79073a118ba4f9e1557b081a /src/lj_gc.c
parentd44337a566bb3de06a6ac4ecf2d2a77767b86029 (diff)
downloadluajit-28cfcf77445e144335961a020e3e08d84cf0091f.tar.gz
luajit-28cfcf77445e144335961a020e3e08d84cf0091f.tar.bz2
luajit-28cfcf77445e144335961a020e3e08d84cf0091f.zip
String buffer refactoring, part 1.
Move string buffer handling to lj_buf.*. Use common buffer resizing function.
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r--src/lj_gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index 79f8b720..4ce6eb19 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -12,6 +12,7 @@
12#include "lj_obj.h" 12#include "lj_obj.h"
13#include "lj_gc.h" 13#include "lj_gc.h"
14#include "lj_err.h" 14#include "lj_err.h"
15#include "lj_buf.h"
15#include "lj_str.h" 16#include "lj_str.h"
16#include "lj_tab.h" 17#include "lj_tab.h"
17#include "lj_func.h" 18#include "lj_func.h"
@@ -353,8 +354,7 @@ static void gc_shrink(global_State *g, lua_State *L)
353{ 354{
354 if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1) 355 if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1)
355 lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */ 356 lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */
356 if (g->tmpbuf.sz > LJ_MIN_SBUF*2) 357 lj_buf_shrink(L, &g->tmpbuf); /* Shrink temp buffer. */
357 lj_str_resizebuf(L, &g->tmpbuf, g->tmpbuf.sz >> 1); /* Shrink temp buf. */
358} 358}
359 359
360/* Type of GC free functions. */ 360/* Type of GC free functions. */