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

@@ -11,6 +11,7 @@
#if LJ_HASJIT && (LJ_SOFTFP || (LJ_32 && LJ_HASFFI))
#include "lj_err.h"
#include "lj_buf.h"
#include "lj_str.h"
#include "lj_ir.h"
#include "lj_jit.h"
@@ -201,7 +202,7 @@ static void split_ir(jit_State *J)
IRRef nins = J->cur.nins, nk = J->cur.nk;
MSize irlen = nins - nk;
MSize need = (irlen+1)*(sizeof(IRIns) + sizeof(IRRef1));
IRIns *oir = (IRIns *)lj_str_needbuf(J->L, &G(J->L)->tmpbuf, need);
IRIns *oir = (IRIns *)lj_buf_tmp(J->L, need);
IRRef1 *hisubst;
IRRef ref;