Module Advanced.Pool

Memory pool for efficient allocation/deallocation

type t = {
  1. device : Device.t;
  2. mutable total_allocated : int64;
  3. mutable allocations : int;
}
val create : Device.t -> _initial_size:int -> t

Create a new memory pool on device

val alloc : t -> ('a, 'b) Vector.kind -> int -> ('a, 'b) Vector.t

Allocate from pool

val reset : t -> unit

Reset pool - free all allocations

val destroy : t -> unit

Destroy pool

val stats : t -> int * int64

Get pool statistics