diff options
Diffstat (limited to '')
| -rw-r--r-- | testes/memerr.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testes/memerr.lua b/testes/memerr.lua index 9c940ca7..a55514a9 100644 --- a/testes/memerr.lua +++ b/testes/memerr.lua | |||
| @@ -282,6 +282,25 @@ testamem("growing stack", function () | |||
| 282 | return foo(100) | 282 | return foo(100) |
| 283 | end) | 283 | end) |
| 284 | 284 | ||
| 285 | |||
| 286 | collectgarbage() | ||
| 287 | collectgarbage() | ||
| 288 | global io, T, setmetatable, collectgarbage, print | ||
| 289 | |||
| 290 | local Count = 0 | ||
| 291 | testamem("finalizers", function () | ||
| 292 | local X = false | ||
| 293 | local obj = setmetatable({}, {__gc = function () X = true end}) | ||
| 294 | obj = nil | ||
| 295 | T.resetCI() -- remove extra CallInfos | ||
| 296 | T.reallocstack(18) -- remove extra stack slots | ||
| 297 | Count = Count + 1 | ||
| 298 | io.stderr:write(Count, "\n") | ||
| 299 | T.trick(io) | ||
| 300 | collectgarbage() | ||
| 301 | return X | ||
| 302 | end) | ||
| 303 | |||
| 285 | -- }================================================================== | 304 | -- }================================================================== |
| 286 | 305 | ||
| 287 | 306 | ||
