# pools

Dark Mode

- Manual
- Standard library
- Index
- Compiler docs
- Fusion docs

Search:

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.

This is an include file that simply imports common modules for your convenience:

    include prelude

Same as:

    import os, strutils, times, parseutils, hashes, tables, sets
    when not defined(js): import parseopt

# Imports

typetraits, os, strutils, times, parseutils, hashes, tables, sets, parseopt

# 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