ThreadLocalBuffer
ThreadLocalBuffer
Section titled “ThreadLocalBuffer”#include <sbio/storage/thread_local_buffer.hh>struct ThreadLocalBufferDefined in src/lib/sbio/storage/thread_local_buffer.hh:28
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
ptr |
function |
Declared here |
size |
function |
Declared here |
set_memory |
function |
Declared here |
memory_space |
function |
Declared here |
m_size |
variable |
Declared here |
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void * |
ptr const inline |
|
std::size_t |
size const inline |
|
void |
set_memory inline |
The ThreadLocalBuffer sets memory in a delayed fashion, only storing size here. |
const inline
inline void * ptr() constDefined in src/lib/sbio/storage/thread_local_buffer.hh:40
const inline
inline std::size_t size() constDefined in src/lib/sbio/storage/thread_local_buffer.hh:82
set_memory
Section titled “set_memory”inline
inline void set_memory(void * ptr, std::size_t size)Defined in src/lib/sbio/storage/thread_local_buffer.hh:95
The ThreadLocalBuffer sets memory in a delayed fashion, only storing size here.
The actual memory allocation occurs on the first retrieval of the underlying buffer pointer. This allows each thread to maintain its own buffer.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ptr |
void * |
Location to allocate memory over. Ignored. |
size |
std::size_t |
The size of the buffer required. |
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
constexpr MemorySpace |
memory_space static inline constexpr |
memory_space
Section titled “memory_space”static inline constexpr
constexpr static inline constexpr MemorySpace memory_space()Defined in src/lib/sbio/storage/thread_local_buffer.hh:30
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
std::size_t |
m_size |
m_size
Section titled “m_size”std::size_t m_size { 0 }Defined in src/lib/sbio/storage/thread_local_buffer.hh:102