include S with type 'a Pointer.t = 'a Tuple_pool.Pointer.t with type Pointer.Id.t = Tuple_pool.Pointer.Id.t with type 'a t = 'a Tuple_pool.t
module Slots : Tuple_type.Slotsmodule Slot : Tuple_type.Slotmodule Pointer : sig ... end with type 'a Pointer.t = 'a Tuple_pool.Pointer.t with type Pointer.Id.t = Tuple_pool.Pointer.Id.ttype 'a t = 'a Tuple_pool.tA pool. 'slots will look like ('a1, ..., 'an) Slots.tn, and the pool holds tuples of type 'a1 * ... * 'an.
val sexp_of_t : ('slots -> Ppx_sexp_conv_lib.Sexp.t) -> 'slots t -> Ppx_sexp_conv_lib.Sexp.tinclude Core_kernel.Invariant.S1 with type 'a t := 'a t
val invariant : ('a -> unit) -> 'a t -> unitpointer_is_valid t pointer returns true iff pointer points to a live tuple in t, i.e. pointer is not null, not free, and is in the range of t.
A pointer might not be in the range of a pool if it comes from another pool for example. In this case unsafe_get/set functions would cause a segfault.
val id_of_pointer : 'slots t -> 'slots Pointer.t -> Pointer.Id.tid_of_pointer t pointer returns an id that is unique for the lifetime of pointer's tuple. When the tuple is freed, the id is no longer valid, and pointer_of_id_exn will fail on it. Pointer.null () has a distinct id from all non-null pointers.
val pointer_of_id_exn : 'slots t -> Pointer.Id.t -> 'slots Pointer.tpointer_of_id_exn t id returns the pointer corresponding to id. It fails if the tuple corresponding to id was already freed.
create slots ~capacity ~dummy creates an empty pool that can hold up to capacity N-tuples. The slots of dummy are stored in free tuples. create raises if capacity < 0 || capacity > max_capacity ~slots_per_tuple.
max_capacity returns the maximum capacity allowed when creating a pool.
val capacity : _ t -> intcapacity returns the maximum number of tuples that the pool can hold.
val length : _ t -> intlength returns the number of tuples currently in the pool.
0 <= length t <= capacity tgrow t ~capacity returns a new pool t' with the supplied capacity. The new pool is to be used as a replacement for t. All live tuples in t are now live in t', and valid pointers to tuples in t are now valid pointers to the identical tuple in t'. It is an error to use t after calling grow t.
grow raises if the supplied capacity isn't larger than capacity t.
val is_full : _ t -> boolis_full t returns true if no more tuples can be allocated in t.
free t pointer frees the tuple pointed to by pointer from t.
unsafe_free t pointer frees the tuple pointed to by pointer without checking pointer_is_valid
new<N> t a0 ... a<N-1> returns a new tuple from the pool, with the tuple's slots initialized to a0 ... a<N-1>. new raises if is_full t.
val new4 : ('a0, 'a1, 'a2, 'a3) Slots.t4 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'slots Pointer.tval new5 : ('a0, 'a1, 'a2, 'a3, 'a4) Slots.t5 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'slots Pointer.tval new6 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5) Slots.t6 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'slots Pointer.tval new7 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6) Slots.t7 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'slots Pointer.tval new8 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7) Slots.t8 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'slots Pointer.tval new9 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8) Slots.t9 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'slots Pointer.tval new10 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8, 'a9) Slots.t10 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'slots Pointer.tval new11 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8, 'a9, 'a10) Slots.t11 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'a10 -> 'slots Pointer.tval new12 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8, 'a9, 'a10, 'a11) Slots.t12 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'a10 -> 'a11 -> 'slots Pointer.tval new13 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8, 'a9, 'a10, 'a11, 'a12) Slots.t13 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'a10 -> 'a11 -> 'a12 -> 'slots Pointer.tval new14 : ('a0, 'a1, 'a2, 'a3, 'a4, 'a5, 'a6, 'a7, 'a8, 'a9, 'a10, 'a11, 'a12, 'a13) Slots.t14 as 'slots t -> 'a0 -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'a10 -> 'a11 -> 'a12 -> 'a13 -> 'slots Pointer.tget_tuple t pointer allocates an OCaml tuple isomorphic to the pool t's tuple pointed to by pointer. The tuple gets copied, but its slots do not.
val get : (_, 'variant) Slots.t as 'slots t -> 'slots Pointer.t -> ('variant, 'slot) Slot.t -> 'slotget t pointer slot gets slot of the tuple pointed to by pointer in pool t.
set t pointer slot a sets to a the slot of the tuple pointed to by pointer in pool t.
In get and set, it is an error to refer to a pointer that has been freed. It is also an error to use a pointer with any pool other than the one the pointer was new'd from or grown to. These errors will lead to undefined behavior, but will not segfault.
unsafe_get is comparable in speed to get for immediate values, and 5%-10% faster for pointers.
unsafe_get and unsafe_set skip bounds checking, and can thus segfault.
val unsafe_get : (_, 'variant) Slots.t as 'slots t -> 'slots Pointer.t -> ('variant, 'slot) Slot.t -> 'slotval check_invariant : bool Core_kernel.refval show_messages : bool Core_kernel.ref