Pool of memory chunks of a specific size. More...
Public Member Functions | |
| pool (pool const &)=delete | |
| pool & | operator= (pool const &)=delete |
| void | reset (void) |
| Resets this pool, releasing all allocated chunks. More... | |
| void | reset (size_type chunk_size, size_type next_size, size_type max_size) |
| Resets this pool, releasing any memory. More... | |
| void | purge (void) |
| Purges the pool, releasing all chunks. More... | |
| void * | allocate (void) |
Returns an available chunk or nullptr if there are none. | |
| void | release (void *p) |
| Releases the given object back to the pool. | |
| bool | empty (void) const |
Returns true if this pool is empty. | |
| size_type | size (void) const |
| Returns the number of allocated chunks. | |
Public Types | |
| typedef std::size_t | size_type |
| typedef void * | value_type |
Pool of memory chunks of a specific size.
| void stapl::runtime::pool::reset | ( | void | ) |
Resets this pool, releasing all allocated chunks.
After this function is called, the pool cannot be used.
| void stapl::runtime::pool::reset | ( | size_type | chunk_size, |
| size_type | next_size, | ||
| size_type | max_size | ||
| ) |
Resets this pool, releasing any memory.
It initializes it to return chunks of chunk_size. A number of next_size chunks are allocated when the pool is empty, up to max_size.
| void stapl::runtime::pool::purge | ( | void | ) |
Purges the pool, releasing all chunks.
1.8.13