svn commit: r355897 - in stable: 11/stand/liblua 12/stand/liblua
Kyle Evans
kevans at FreeBSD.org
Thu Dec 19 02:05:49 UTC 2019
Author: kevans
Date: Thu Dec 19 02:05:48 2019
New Revision: 355897
URL: https://svnweb.freebsd.org/changeset/base/355897
Log:
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.
Modified:
stable/11/stand/liblua/luaconf.h
Directory Properties:
stable/11/ (props changed)
Changes in other areas also in this revision:
Modified:
stable/12/stand/liblua/luaconf.h
Directory Properties:
stable/12/ (props changed)
Modified: stable/11/stand/liblua/luaconf.h
==============================================================================
--- stable/11/stand/liblua/luaconf.h Thu Dec 19 02:04:40 2019 (r355896)
+++ stable/11/stand/liblua/luaconf.h Thu Dec 19 02:05:48 2019 (r355897)
@@ -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
/* }================================================================== */
More information about the svn-src-stable
mailing list