aboutsummaryrefslogtreecommitdiff
path: root/src/lj_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_buf.c')
-rw-r--r--src/lj_buf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lj_buf.c b/src/lj_buf.c
index 32ed52b9..3526a6e5 100644
--- a/src/lj_buf.c
+++ b/src/lj_buf.c
@@ -149,6 +149,15 @@ GCstr * LJ_FASTCALL lj_buf_tostr(SBuf *sb)
149 return lj_str_new(sbufL(sb), sbufB(sb), sbuflen(sb)); 149 return lj_str_new(sbufL(sb), sbufB(sb), sbuflen(sb));
150} 150}
151 151
152GCstr *lj_buf_cat2str(lua_State *L, GCstr *s1, GCstr *s2)
153{
154 MSize len1 = s1->len, len2 = s2->len;
155 char *buf = lj_buf_tmp(L, len1 + len2);
156 memcpy(buf, strdata(s1), len1);
157 memcpy(buf+len1, strdata(s2), len2);
158 return lj_str_new(L, buf, len1 + len2);
159}
160
152uint32_t LJ_FASTCALL lj_buf_ruleb128(const char **pp) 161uint32_t LJ_FASTCALL lj_buf_ruleb128(const char **pp)
153{ 162{
154 const uint8_t *p = (const uint8_t *)*pp; 163 const uint8_t *p = (const uint8_t *)*pp;