WPILibC++ 2025.1.1
|
Manually takes care of the lifetime of the per-thread temporary_stack. More...
#include <wpi/memory/temporary_allocator.hpp>
Classes | |
struct | defer_create_t |
Public Member Functions | |
temporary_stack_initializer (defer_create_t) noexcept | |
temporary_stack_initializer (std::size_t initial_size=default_stack_size) | |
~temporary_stack_initializer () noexcept | |
temporary_stack_initializer (temporary_stack_initializer &&)=delete | |
temporary_stack_initializer & | operator= (temporary_stack_initializer &&)=delete |
Static Public Attributes | |
static constexpr std::size_t | default_stack_size = 4096u |
static const struct wpi::memory::temporary_stack_initializer::defer_create_t | defer_create |
Manually takes care of the lifetime of the per-thread temporary_stack.
The constructor will create it, if not already done, and the destructor will destroy it, if not already done.
main()
. WPI_MEMORY_TEMPORARY_STACK_MODE == 2
, it is not necessary to use this class, the nifty counter will clean everything upon program termination. But it can still be used as an optimization if you have a thread that is terminated long before program exit. The automatic clean up will only occur much later. WPI_MEMORY_TEMPORARY_STACK_MODE == 0
, the use of this class has no effect, because the per-thread stack is disabled.
|
inlinenoexcept |
WPI_MEMORY_TEMPORARY_STACK_MODE == 0
, this function has no effect. wpi::memory::temporary_stack_initializer::temporary_stack_initializer | ( | std::size_t | initial_size = default_stack_size | ) |
initial_size
must not be 0
if WPI_MEMORY_TEMPORARY_STACK_MODE != 0
. WPI_MEMORY_TEMPORARY_STACK_MODE == 0
, this function will issue a warning in debug mode. This can be disabled by passing 0
as the initial size.
|
noexcept |
|
delete |
|
delete |
|
staticconstexpr |
|
static |