Module Pool_intf.Pool.Unsafe

module Unsafe: sig .. end
An Unsafe pool is like an ordinary pool, except that the create function does not require an initial element. The pool stores Obj.magic () as the dummy value for each slot. Such a pool is only safe if one never accesses a slot from a freed tuple.

It makes sense to use Unsafe if one has a small constrained chunk of code where one can prove that one never accesses a freed tuple, and one needs a pool where it is difficult to construct a dummy value.


include Pool_intf.Pool.S
val create : ('a, 'b) Slots.t -> capacity:int -> ('a, 'b) Slots.t t
create slots ~capacity creates an empty pool that can hold up to capacity N-tuples. The elements of a free tuple may contain stale and/or invalid values for their types, and as such any access to a free tuple from this pool is unsafe.