aboutsummaryrefslogtreecommitdiff
path: root/src/lj_str.h
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_str.h
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_str.h')
-rw-r--r--src/lj_str.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/lj_str.h b/src/lj_str.h
index 3aa03662..3dcd1a9b 100644
--- a/src/lj_str.h
+++ b/src/lj_str.h
@@ -37,14 +37,4 @@ LJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...)
37#endif 37#endif
38 ; 38 ;
39 39
40/* Resizable string buffers. Struct definition in lj_obj.h. */
41LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz);
42
43#define lj_str_initbuf(sb) ((sb)->buf = NULL, (sb)->sz = 0)
44#define lj_str_resetbuf(sb) ((sb)->n = 0)
45#define lj_str_resizebuf(L, sb, size) \
46 ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \
47 (sb)->sz = (size))
48#define lj_str_freebuf(g, sb) lj_mem_free(g, (void *)(sb)->buf, (sb)->sz)
49
50#endif 40#endif