String buffer refactoring, part 1.

Move string buffer handling to lj_buf.*.
Use common buffer resizing function.
This commit is contained in:
Mike Pall
2013-02-27 17:11:31 +01:00
parent d44337a566
commit 28cfcf7744
22 changed files with 197 additions and 184 deletions

View File

@@ -15,6 +15,7 @@
#include "lj_obj.h"
#include "lj_gc.h"
#include "lj_err.h"
#include "lj_buf.h"
#include "lj_str.h"
#include "lj_func.h"
#include "lj_frame.h"
@@ -54,7 +55,7 @@ LUA_API int lua_loadx(lua_State *L, lua_Reader reader, void *data,
ls.rdata = data;
ls.chunkarg = chunkname ? chunkname : "?";
ls.mode = mode;
lj_str_initbuf(&ls.sb);
lj_buf_init(&ls.sb);
status = lj_vm_cpcall(L, NULL, &ls, cpparser);
lj_lex_cleanup(L, &ls);
lj_gc_check(L);