src/fusion/pools

Pooled allocation for Nim. Usage:

var p: Pool[MyObjectType]
var n0 = newNode(p)
var n1 = newNode(p)

The destructor of Pool is resonsible for bulk-freeing every object constructed by the Pool. Pools cannot be copied.

Types

Pool[T] = object
  len: int
  last: ptr Chunk[T]
  lastCap: int
A pool of 'T' nodes.

Procs

proc `=copy`[T](dest: var Pool[T]; src: Pool[T]) {.error.}
proc `=destroy`[T](p: var Pool[T])
proc newNode[T](p: var Pool[T]): ptr T