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.


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


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