Lines Matching full:pool
21 * All allocated memory must be released back to the pool before it can be destroyed or recycled.
24 class Pool {
26 ~Pool();
28 // Creates a pool to store objects during program creation. Call attachToThread() to start using
29 // the pool for its allocations. When your program is complete, call pool->detachFromThread() to
30 // take ownership of the pool and its allocations. Before freeing any of the program's
31 // allocations, make sure to reattach the pool by calling pool->attachToThread() again.
32 static std::unique_ptr<Pool> Create();
34 // Attaches a pool to the current thread.
35 // It is an error to call this while a pool is already attached.
38 // Once you are done creating or destroying objects in the pool, detach it from the thread.
39 // It is an error to call this while no pool is attached.
42 // Allocates memory from the thread pool. If the pool is exhausted, an additional block of pool
46 // Releases memory that was created by AllocMemory. All objects in the pool must be freed before
47 // the pool can be destroyed.
55 Pool() = default; // use Create to make a pool
60 * If your class inherits from Poolable, its objects will be allocated from the pool.
64 // Override operator new and delete to allow us to use a memory pool.
66 return Pool::AllocMemory(size); in new()
70 Pool::FreeMemory(ptr); in delete()