diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-01-24 22:46:21 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-01-24 22:46:21 +0100 |
commit | 68d8db431ec2b739dc53233d6b4d8aeee9324e48 (patch) | |
tree | d8f0fbe0f8c4e1a07ac4248fd1b7673f49beb4d3 /tests/linda_perf.lua | |
parent | 623fb3c0cae9beb3d5e7d3f7424b47d80041c1ac (diff) | |
download | lanes-68d8db431ec2b739dc53233d6b4d8aeee9324e48.tar.gz lanes-68d8db431ec2b739dc53233d6b4d8aeee9324e48.tar.bz2 lanes-68d8db431ec2b739dc53233d6b4d8aeee9324e48.zip |
version 3.4.3v3.4.3
* raise an error if lane generator libs specification contains a lib more than once
* bit32 is a valid lib name in the libs specification (silently ignored by the Lua 5.1 build)
* improved lanes.nameof to search inside table- and userdata- metatables for an object's name
* fixed an unwarranted error when trying to discover a function name upon a failed transfer
* contents of package.[path,cpath,preload,loaders|searchers] are pulled *only once* inside keeper states at initialisation
* Lua function upvalues equal to the global environment aren't copied by value, but bound to the destination's global environment
especially useful for Lua 5.2 _ENV
* fixed loading of base libraries that didn't create the global tables when built for Lua 5.2
Diffstat (limited to 'tests/linda_perf.lua')
-rw-r--r-- | tests/linda_perf.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/linda_perf.lua b/tests/linda_perf.lua index 87e0da7..be582ce 100644 --- a/tests/linda_perf.lua +++ b/tests/linda_perf.lua | |||
@@ -1,6 +1,9 @@ | |||
1 | local lanes = require "lanes" | 1 | local lanes = require "lanes" |
2 | lanes.configure() | 2 | lanes.configure() |
3 | 3 | ||
4 | -- Lua 5.1/5.2 compatibility | ||
5 | local table_unpack = unpack or table.unpack | ||
6 | |||
4 | -- this lane eats items in the linda one by one | 7 | -- this lane eats items in the linda one by one |
5 | local eater = function( l, loop) | 8 | local eater = function( l, loop) |
6 | local key, val = l:receive( "go") | 9 | local key, val = l:receive( "go") |
@@ -131,7 +134,7 @@ local function ziva2( preloop, loop, batch) | |||
131 | end | 134 | end |
132 | -- create a function that can send several values in one shot | 135 | -- create a function that can send several values in one shot |
133 | batch_send = function() | 136 | batch_send = function() |
134 | l:send( "key", unpack( batch_values)) | 137 | l:send( "key", table_unpack( batch_values)) |
135 | end | 138 | end |
136 | batch_read = function() | 139 | batch_read = function() |
137 | l:receive( l.batched, "key", batch) | 140 | l:receive( l.batched, "key", batch) |