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.   Source Edit

Procs

proc newNode[T](p: var Pool[T]): ptr T
  Source Edit