Module AllocCache.Arr
val create : ?buck_size:int -> int -> 'a t
create n
makes a new cache of arrays up to lengthn
- parameter buck_size
number of arrays cached for each array length
- parameter n
maximum size of arrays put in cache
val make : 'a t -> int -> 'a -> 'a array
make cache i x
is likeArray.make i x
, but might return a cached array instead of allocating one. NOTE: if the array is already allocated then it will NOT be filled withx
val free : 'a t -> 'a array -> unit
Return array to the cache. The array's elements will not be GC'd