diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-04 16:40:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-04 16:40:18 -0300 |
commit | bfcf06d91a87b7ffb8c83e290db0cb6176a167f8 (patch) | |
tree | 0bcba905a2772e536c845e39e9eeed0c7330312c /testes/coroutine.lua | |
parent | 0280407fc54f9b6225139c5ac27326f98f0cf043 (diff) | |
download | lua-bfcf06d91a87b7ffb8c83e290db0cb6176a167f8.tar.gz lua-bfcf06d91a87b7ffb8c83e290db0cb6176a167f8.tar.bz2 lua-bfcf06d91a87b7ffb8c83e290db0cb6176a167f8.zip |
Avoid memory allocation in some functions from 'ltests.c'
To allow their use in memory tests, some functions in 'ltests.c'
should never allocate memory. To avoid this allocation, the
library registers the strings used for status codes, and keeps
the variable '_WARN' always defined (with false instead of nil).
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r-- | testes/coroutine.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 73333c14..0a4c2ef3 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
@@ -184,7 +184,7 @@ do | |||
184 | if not T then | 184 | if not T then |
185 | warn("@on") | 185 | warn("@on") |
186 | else -- test library | 186 | else -- test library |
187 | assert(string.find(_WARN, "200")); _WARN = nil | 187 | assert(string.find(_WARN, "200")); _WARN = false |
188 | warn("@normal") | 188 | warn("@normal") |
189 | end | 189 | end |
190 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) | 190 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) |