Turi Create
4.0
|
#include <core/util/buffer_pool.hpp>
Public Member Functions | |
void | init (size_t buffer_size) |
std::shared_ptr< T > | get_new_buffer () |
void | release_buffer (std::shared_ptr< T > &&buffer) |
Implements a buffer pool around collections of T. The buffer is lazily allocated; but only up to 2 * buffer_size entries can exist.
Definition at line 22 of file buffer_pool.hpp.
|
inline |
Returns a new buffer from the buffer pool Can be called in parallel
Definition at line 40 of file buffer_pool.hpp.
|
inline |
Initializes the buffer pool to a certain capacity. Can be called in parallel
Definition at line 32 of file buffer_pool.hpp.
|
inline |
Releases a buffer back to the pool Can be called in parallel
Definition at line 67 of file buffer_pool.hpp.