aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-09-05 15:30:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-09-05 15:30:45 -0300
commit14e416355f83cf0a1b871eedec2c92b86dbe76d6 (patch)
tree620c7fa0b811d5f91d3d2f9b4879b289df6d137c /ltests.c
parentf33cda8d6eb1cac5b9042429e85f1096175c7ca5 (diff)
downloadlua-14e416355f83cf0a1b871eedec2c92b86dbe76d6.tar.gz
lua-14e416355f83cf0a1b871eedec2c92b86dbe76d6.tar.bz2
lua-14e416355f83cf0a1b871eedec2c92b86dbe76d6.zip
Added suport for Fixed Buffers
A fixed buffer keeps a binary chunk "forever", so that the program does not need to copy some of its parts when loading it.
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ltests.c b/ltests.c
index e218778a..15d1a564 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1513,8 +1513,11 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
1513 luaL_loadfile(L1, luaL_checkstring(L1, getnum)); 1513 luaL_loadfile(L1, luaL_checkstring(L1, getnum));
1514 } 1514 }
1515 else if EQ("loadstring") { 1515 else if EQ("loadstring") {
1516 const char *s = luaL_checkstring(L1, getnum); 1516 size_t slen;
1517 luaL_loadstring(L1, s); 1517 const char *s = luaL_checklstring(L1, getnum, &slen);
1518 const char *name = getstring;
1519 const char *mode = getstring;
1520 luaL_loadbufferx(L1, s, slen, name, mode);
1518 } 1521 }
1519 else if EQ("newmetatable") { 1522 else if EQ("newmetatable") {
1520 lua_pushboolean(L1, luaL_newmetatable(L1, getstring)); 1523 lua_pushboolean(L1, luaL_newmetatable(L1, getstring));