--[[
Freelist for Terra based on a dynamic array.
Written by Cosmin Apreutesei. Public Domain.
Element pointers are not stable between allocations, but their indices are,
which is why alloc() also return the element id (i.e. index).
local fl = arrayfreelist(T, [size_t], [context_t])
fl:init()
fl:free()
fl:alloc() -> e, id
fl:new(...) -> e, id
fl:release()
fl.livecount -> n
]]
See the source code for more info.