Added vec2 support for multiple concurrent release to pool

This commit is contained in:
Max Cahill 2021-06-08 11:48:58 +10:00
parent b5d3707939
commit bcd94c134e

View File

@ -92,10 +92,13 @@ function vec2:pooled_copy()
end end
--release a vector to the pool --release a vector to the pool
function vec2:release() function vec2:release(...)
if vec2.pool_size() < _vec2_pool_limit then if vec2.pool_size() < _vec2_pool_limit then
table.insert(_vec2_pool, self) table.insert(_vec2_pool, self)
end end
if ... then
vec2.release(...)
end
end end
--unpack for multi-args --unpack for multi-args