Replace the client's six luaL_Buffer functions so full 512-byte chunks go to a C-heap buffer and only the final Lua string is created, instead of a Lua string per chunk plus every merge. Fixes all users at once with identical output (argument checks, getn/setn, number conversion and errors remain the client's code). All-or-nothing install, refused if another DLL patched the functions; strbuf=0 in ducielperf.cfg switches it off. tests/test_strbuf: the same core on real Lua 5.0.3 (512-byte buffer), ~26,000 generated cases per run byte-identical to the original, abandoned builds released, and allocation/time benchmarks (table.concat 500 lines: 110 KB -> 25 KB allocated, 28 -> 20 us). Adds config_int (ducielperf.cfg) and hook_remove to the core, and DucielPerf_GetStringBufferStats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 lines
139 B
C
4 lines
139 B
C
/* Forced into lmem.c for test_strbuf: counts Lua heap growth. */
|
|
#include <stddef.h>
|
|
void *dp_test_realloc(void *b, size_t os, size_t s);
|