aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lanes.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lanes.lua b/src/lanes.lua
index 6342ca9..7c1f8df 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -108,7 +108,7 @@ local default_params =
108-- ################################################################################################# 108-- #################################################################################################
109 109
110local boolean_param_checker = function(val_) 110local boolean_param_checker = function(val_)
111 -- non-'boolean-false' should be 'boolean-true' or nil 111 -- non-'boolean-false|nil' should be 'boolean-true'
112 return (not val_) or (val_ == true) 112 return (not val_) or (val_ == true)
113end 113end
114 114
@@ -116,7 +116,7 @@ local param_checkers =
116{ 116{
117 allocator = function(val_) 117 allocator = function(val_)
118 -- can be nil, "protected", or a function 118 -- can be nil, "protected", or a function
119 return val_ and (type(val_) == "function" or val_ == "protected") or true 119 return (val_ == nil) or (type(val_) == "function" or val_ == "protected")
120 end, 120 end,
121 internal_allocator = function(val_) 121 internal_allocator = function(val_)
122 -- can be "libc" or "allocator" 122 -- can be "libc" or "allocator"
@@ -128,11 +128,11 @@ local param_checkers =
128 end, 128 end,
129 nb_user_keepers = function(val_) 129 nb_user_keepers = function(val_)
130 -- nb_user_keepers should be a number in [0,100] (so that nobody tries to run OOM by specifying a huge amount) 130 -- nb_user_keepers should be a number in [0,100] (so that nobody tries to run OOM by specifying a huge amount)
131 return type(val_) == "number" and val_ >= 0 and val_ <= 100 131 return (type(val_) == "number") and (val_ >= 0) and (val_ <= 100)
132 end, 132 end,
133 on_state_create = function(val_) 133 on_state_create = function(val_)
134 -- on_state_create may be nil or a function 134 -- on_state_create may be nil or a function
135 return val_ and type(val_) == "function" or true 135 return (val_ == nil) or (type(val_) == "function")
136 end, 136 end,
137 shutdown_mode = function(val_) 137 shutdown_mode = function(val_)
138 local valid_hooks = { soft = true, hard = true, call = true, ret = true, line = true, count = true } 138 local valid_hooks = { soft = true, hard = true, call = true, ret = true, line = true, count = true }