Date: Thu, 12 Dec 2019 01:35:56 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355640 - head/stand/liblua Message-ID: <201912120135.xBC1ZuNv063143@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Thu Dec 12 01:35:56 2019 New Revision: 355640 URL: https://svnweb.freebsd.org/changeset/base/355640 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. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22500 Modified: head/stand/liblua/luaconf.h Modified: head/stand/liblua/luaconf.h ============================================================================== --- head/stand/liblua/luaconf.h Thu Dec 12 01:33:45 2019 (r355639) +++ head/stand/liblua/luaconf.h Thu Dec 12 01:35:56 2019 (r355640) @@ -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 /* }================================================================== */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912120135.xBC1ZuNv063143>