diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-13 13:12:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-13 13:12:33 -0300 |
| commit | 6d042a178fba32d10ec23c98fb2fd284397ccddc (patch) | |
| tree | f68f9c48a5c3832e929f1317bfd83750ca13b17d /testes/gc.lua | |
| parent | eabf425c76e0089eb88e102e2a44d8c8a37bc213 (diff) | |
| download | lua-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.lua | 3 |
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 |
