![]() |
WPILibC++ 2025.3.2
|
A stateful RawAllocator that handles temporary allocations. More...
#include <wpi/memory/temporary_allocator.hpp>
Public Member Functions | |
| temporary_allocator () | |
| temporary_allocator (temporary_stack &stack) | |
| ~temporary_allocator () noexcept | |
| temporary_allocator (temporary_allocator &&)=delete | |
| temporary_allocator & | operator= (temporary_allocator &&)=delete |
| void * | allocate (std::size_t size, std::size_t alignment) |
| bool | is_active () const noexcept |
| void | shrink_to_fit () noexcept |
| temporary_stack & | get_stack () const noexcept |
A stateful RawAllocator that handles temporary allocations.
It works similar to alloca() but uses a seperate memory_stack for the allocations, instead of the actual program stack. This avoids the stack overflow error and is portable, with a similar speed. All allocations done in the scope of the allocator object are automatically freed when the object is destroyed.
| wpi::memory::temporary_allocator::temporary_allocator | ( | ) |
0).
|
explicit |
|
noexcept |
|
delete |
| void * wpi::memory::temporary_allocator::allocate | ( | std::size_t | size, |
| std::size_t | alignment ) |
is_active() must return true.
|
inlinenoexcept |
is_active() must return true.
|
noexcept |
|
delete |
|
noexcept |