src/fusion/pools

Search:
Group by:

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
A pool of 'T' nodes.

Procs

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