aboutsummaryrefslogtreecommitdiff
path: root/testes/cstack.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/cstack.lua')
-rw-r--r--testes/cstack.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/testes/cstack.lua b/testes/cstack.lua
index 8ac48e89..7bd55063 100644
--- a/testes/cstack.lua
+++ b/testes/cstack.lua
@@ -135,14 +135,18 @@ if T then
135 local topB, sizeB -- top and size Before overflow 135 local topB, sizeB -- top and size Before overflow
136 local topA, sizeA -- top and size After overflow 136 local topA, sizeA -- top and size After overflow
137 topB, sizeB = T.stacklevel() 137 topB, sizeB = T.stacklevel()
138 collectgarbage("stop") -- __gc should not be called with a full stack
138 xpcall(f, err) 139 xpcall(f, err)
140 collectgarbage("restart")
139 topA, sizeA = T.stacklevel() 141 topA, sizeA = T.stacklevel()
140 -- sizes should be comparable 142 -- sizes should be comparable
141 assert(topA == topB and sizeA < sizeB * 2) 143 assert(topA == topB and sizeA < sizeB * 2)
142 print(string.format("maximum stack size: %d", stack1)) 144 print(string.format("maximum stack size: %d", stack1))
143 LIM = N -- will stop recursion at maximum level 145 LIM = N -- will stop recursion at maximum level
144 N = 0 -- to count again 146 N = 0 -- to count again
147 collectgarbage("stop") -- __gc should not be called with a full stack
145 f() 148 f()
149 collectgarbage("restart")
146 print"+" 150 print"+"
147end 151end
148 152