aboutsummaryrefslogtreecommitdiff
path: root/testes/gc.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-13 13:12:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-13 13:12:33 -0300
commit6d042a178fba32d10ec23c98fb2fd284397ccddc (patch)
treef68f9c48a5c3832e929f1317bfd83750ca13b17d /testes/gc.lua
parenteabf425c76e0089eb88e102e2a44d8c8a37bc213 (diff)
downloadlua-6d042a178fba32d10ec23c98fb2fd284397ccddc.tar.gz
lua-6d042a178fba32d10ec23c98fb2fd284397ccddc.tar.bz2
lua-6d042a178fba32d10ec23c98fb2fd284397ccddc.zip
Auxiliary buffer uses external strings
The buffer system from the auxiliary library reuses its buffer as external memory when closing long strings.
Diffstat (limited to 'testes/gc.lua')
-rw-r--r--testes/gc.lua3
1 files changed, 0 insertions, 3 deletions
diff --git a/testes/gc.lua b/testes/gc.lua
index 03093e34..3c928d7c 100644
--- a/testes/gc.lua
+++ b/testes/gc.lua
@@ -460,10 +460,7 @@ do -- tests for string keys in weak tables
460 a[string.rep("a", 2^22)] = 25 -- long string key -> number value 460 a[string.rep("a", 2^22)] = 25 -- long string key -> number value
461 a[string.rep("b", 2^22)] = {} -- long string key -> colectable value 461 a[string.rep("b", 2^22)] = {} -- long string key -> colectable value
462 a[{}] = 14 -- colectable key 462 a[{}] = 14 -- colectable key
463 assert(collectgarbage("count") > m + 2^13) -- 2^13 == 2 * 2^22 in KB
464 collectgarbage() 463 collectgarbage()
465 assert(collectgarbage("count") >= m + 2^12 and
466 collectgarbage("count") < m + 2^13) -- one key was collected
467 local k, v = next(a) -- string key with number value preserved 464 local k, v = next(a) -- string key with number value preserved
468 assert(k == string.rep("a", 2^22) and v == 25) 465 assert(k == string.rep("a", 2^22) and v == 25)
469 assert(next(a, k) == nil) -- everything else cleared 466 assert(next(a, k) == nil) -- everything else cleared