diff options
Diffstat (limited to 'testes/memerr.lua')
| -rw-r--r-- | testes/memerr.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/memerr.lua b/testes/memerr.lua index 69d2ef85..2cc8f481 100644 --- a/testes/memerr.lua +++ b/testes/memerr.lua | |||
| @@ -126,13 +126,13 @@ testamem("coroutine creation", function() | |||
| 126 | end) | 126 | end) |
| 127 | 127 | ||
| 128 | do -- vararg tables | 128 | do -- vararg tables |
| 129 | local function pack (... | t) return t end | 129 | local function pack (...t) return t end |
| 130 | local b = testamem("vararg table", function () | 130 | local b = testamem("vararg table", function () |
| 131 | return pack(10, 20, 30, 40, "hello") | 131 | return pack(10, 20, 30, 40, "hello") |
| 132 | end) | 132 | end) |
| 133 | assert(b.aloc == 3) -- new table uses three memory blocks | 133 | assert(b.aloc == 3) -- new table uses three memory blocks |
| 134 | -- table optimized away | 134 | -- table optimized away |
| 135 | local function sel (n, ...|arg) return arg[n] + arg.n end | 135 | local function sel (n, ...arg) return arg[n] + arg.n end |
| 136 | local b = testamem("optimized vararg table", | 136 | local b = testamem("optimized vararg table", |
| 137 | function () return sel(2.0, 20, 30) end) | 137 | function () return sel(2.0, 20, 30) end) |
| 138 | assert(b.res == 32 and b.aloc == 0) -- no memory needed for this case | 138 | assert(b.res == 32 and b.aloc == 0) -- no memory needed for this case |
