WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
wpi::memory::null_allocator Class Reference

A composable RawAllocator that will always fail. More...

#include <wpi/memory/segregator.hpp>

Public Member Functions

void * allocate_node (std::size_t size, std::size_t)
 
void deallocate_node (void *, std::size_t, std::size_t) noexcept
 
void * try_allocate_node (std::size_t, std::size_t) noexcept
 
bool try_deallocate_node (void *, std::size_t, std::size_t) noexcept
 

Detailed Description

A composable RawAllocator that will always fail.

This is useful for compositioning or as last resort in binary_segregator.

Member Function Documentation

◆ allocate_node()

void * wpi::memory::null_allocator::allocate_node ( std::size_t size,
std::size_t  )
inline
Effects:
Will always throw.
Throws:
A out_of_fixed_memory exception.

◆ deallocate_node()

void wpi::memory::null_allocator::deallocate_node ( void * ,
std::size_t ,
std::size_t  )
inlinenoexcept
Requires:
Must not be called.

◆ try_allocate_node()

void * wpi::memory::null_allocator::try_allocate_node ( std::size_t ,
std::size_t  )
inlinenoexcept
Effects:
Does nothing.
Returns:
Always returns nullptr.

◆ try_deallocate_node()

bool wpi::memory::null_allocator::try_deallocate_node ( void * ,
std::size_t ,
std::size_t  )
inlinenoexcept
Effects:
Does nothing.
Returns:
Always returns false.

The documentation for this class was generated from the following file: