aboutsummaryrefslogtreecommitdiff
path: root/stand/liblua
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-12-12 01:35:56 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-12-12 01:35:56 +0000
commitbf471326054965ef4a8210b2719d30eaf844c5d1 (patch)
tree04fbc0f76e4242947dbf4e4339ef5a87204ab599 /stand/liblua
parent5bff36fe81291488a7f019dd26dd4d3591cdfd22 (diff)
downloadsrc-bf471326054965ef4a8210b2719d30eaf844c5d1.tar.gz
src-bf471326054965ef4a8210b2719d30eaf844c5d1.zip
stand: liblua: drop default buffer size to 128
Lua allocates LUAL_BUFFERSIZE buffers on the stack for various string functions (string.format, string.gsub) -- this works out to be somewhat significant and not necessary, based on how we use string operations. Dropping it risks having to allocate per call to format/gsub, but this is not the case for our usage. This simply stops allocating 8K buffers on the stack when luaL_Buffer is used. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22500
Notes
Notes: svn path=/head/; revision=355640
Diffstat (limited to 'stand/liblua')
-rw-r--r--stand/liblua/luaconf.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/stand/liblua/luaconf.h b/stand/liblua/luaconf.h
index dd642cba92f4..e3275c13c4b5 100644
--- a/stand/liblua/luaconf.h
+++ b/stand/liblua/luaconf.h
@@ -783,11 +783,7 @@
** smaller buffer would force a memory allocation for each call to
** 'string.format'.)
*/
-#if LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE
-#define LUAL_BUFFERSIZE 8192
-#else
-#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer)))
-#endif
+#define LUAL_BUFFERSIZE 128
/* }================================================================== */