From 6d042a178fba32d10ec23c98fb2fd284397ccddc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 13 Nov 2023 13:12:33 -0300 Subject: Auxiliary buffer uses external strings The buffer system from the auxiliary library reuses its buffer as external memory when closing long strings. --- testes/locals.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'testes/locals.lua') diff --git a/testes/locals.lua b/testes/locals.lua index 2c48546d..090d846b 100644 --- a/testes/locals.lua +++ b/testes/locals.lua @@ -728,14 +728,8 @@ if rawget(_G, "T") then -- first buffer was released by 'toclose' assert(T.totalmem() - m <= extra) - -- error in creation of final string - T.totalmem(m + 2 * lim + extra) - assert(not pcall(table.concat, a)) - -- second buffer was released by 'toclose' - assert(T.totalmem() - m <= extra) - - -- userdata, buffer, buffer, final string - T.totalmem(m + 4*lim + extra) + -- userdata, buffer, final string + T.totalmem(m + 2*lim + extra) assert(#table.concat(a) == 2*lim) T.totalmem(0) -- remove memory limit -- cgit v1.2.3-55-g6feb