IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::AllocatorBase< WithDebugInfo > Struct Template Referenceabstract

#include <ice/mem_allocator.hxx>

Public Member Functions

 AllocatorBase (std::source_location const &) noexcept
 AllocatorBase (std::source_location const &, std::string_view) noexcept
 AllocatorBase (std::source_location const &, AllocatorBase &) noexcept
 AllocatorBase (std::source_location const &, AllocatorBase &, std::string_view) noexcept
auto allocate (ice::AllocRequest request) noexcept -> ice::AllocResult
auto allocate (ice::ChunkedAllocRequest const &request) noexcept -> ice::AllocResult
template<typename T>
requires std::is_trivial_v<T>
auto allocate (ice::u64 count=1) noexcept -> T *
void deallocate (void *pointer) noexcept
void deallocate (ice::Memory result) noexcept
template<typename T, typename... Args>
auto create (Args &&... args) noexcept -> T *
template<typename T>
void destroy (T *object) noexcept
auto allocation_count () const noexcept -> ice::u32
auto allocation_total_count () const noexcept -> ice::u32
auto allocation_size_inuse () const noexcept -> ice::usize
auto allocation_size_watermark () const noexcept -> ice::usize
virtual auto allocation_size (void *ptr) const noexcept -> ice::usize
auto debug_info () const noexcept -> ice::AllocatorDebugInfo const &
 Gives access to debug information for an allocator.

Static Public Attributes

static constexpr ice::usize SizeNotTracked = { static_cast<ice::usize::base_type>(0xFFFFEEEE'EEEEFFFF) }
static constexpr ice::u32 CountNotTracked = 0xFFFF'FFFF
static constexpr bool HasDebugInformation = WithDebugInfo

Protected Member Functions

virtual ~AllocatorBase () noexcept=default
virtual auto do_allocate (ice::AllocRequest request) noexcept -> ice::AllocResult=0
virtual void do_deallocate (void *pointer) noexcept=0

Constructor & Destructor Documentation

◆ AllocatorBase() [1/4]

template<bool WithDebugInfo>
ice::AllocatorBase< WithDebugInfo >::AllocatorBase ( std::source_location const & )
inlinenoexcept

◆ AllocatorBase() [2/4]

template<bool WithDebugInfo>
ice::AllocatorBase< WithDebugInfo >::AllocatorBase ( std::source_location const & ,
std::string_view  )
inlinenoexcept

◆ AllocatorBase() [3/4]

template<bool WithDebugInfo>
ice::AllocatorBase< WithDebugInfo >::AllocatorBase ( std::source_location const & ,
AllocatorBase< WithDebugInfo > &  )
inlinenoexcept

◆ AllocatorBase() [4/4]

template<bool WithDebugInfo>
ice::AllocatorBase< WithDebugInfo >::AllocatorBase ( std::source_location const & ,
AllocatorBase< WithDebugInfo > & ,
std::string_view  )
inlinenoexcept

◆ ~AllocatorBase()

template<bool WithDebugInfo>
virtual ice::AllocatorBase< WithDebugInfo >::~AllocatorBase ( )
protectedvirtualdefaultnoexcept

Member Function Documentation

◆ allocate() [1/3]

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocate ( ice::AllocRequest request) -> ice::AllocResult
inlinenoexcept

◆ allocate() [2/3]

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocate ( ice::ChunkedAllocRequest const & request) -> ice::AllocResult
inlinenoexcept

◆ allocate() [3/3]

template<bool WithDebugInfo>
template<typename T>
requires std::is_trivial_v<T>
auto ice::AllocatorBase< WithDebugInfo >::allocate ( ice::u64 count = 1) -> T *
inlinenoexcept

◆ allocation_count()

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocation_count ( ) const -> ice::u32
inlinenoexcept

◆ allocation_size()

template<bool WithDebugInfo>
virtual auto ice::AllocatorBase< WithDebugInfo >::allocation_size ( void * ptr) const -> ice::usize
inlinevirtualnoexcept

◆ allocation_size_inuse()

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocation_size_inuse ( ) const -> ice::usize
inlinenoexcept

◆ allocation_size_watermark()

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocation_size_watermark ( ) const -> ice::usize
inlinenoexcept

◆ allocation_total_count()

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::allocation_total_count ( ) const -> ice::u32
inlinenoexcept

◆ create()

template<bool WithDebugInfo>
template<typename T, typename... Args>
auto ice::AllocatorBase< WithDebugInfo >::create ( Args &&... args) -> T *
inlinenoexcept

◆ deallocate() [1/2]

template<bool WithDebugInfo>
void ice::AllocatorBase< WithDebugInfo >::deallocate ( ice::Memory result)
inlinenoexcept

◆ deallocate() [2/2]

template<bool WithDebugInfo>
void ice::AllocatorBase< WithDebugInfo >::deallocate ( void * pointer)
inlinenoexcept

◆ debug_info()

template<bool WithDebugInfo>
auto ice::AllocatorBase< WithDebugInfo >::debug_info ( ) const -> ice::AllocatorDebugInfo const &
noexcept

Gives access to debug information for an allocator.

Note
This symbol is not defined for AllocatorBase<false> and accessing it should be done inside a if constexpr clause.

◆ destroy()

template<bool WithDebugInfo>
template<typename T>
void ice::AllocatorBase< WithDebugInfo >::destroy ( T * object)
inlinenoexcept

◆ do_allocate()

◆ do_deallocate()

template<bool WithDebugInfo>
virtual void ice::AllocatorBase< WithDebugInfo >::do_deallocate ( void * pointer)
protectedpure virtualnoexcept

Member Data Documentation

◆ CountNotTracked

template<bool WithDebugInfo>
ice::u32 ice::AllocatorBase< WithDebugInfo >::CountNotTracked = 0xFFFF'FFFF
staticconstexpr

◆ HasDebugInformation

template<bool WithDebugInfo>
bool ice::AllocatorBase< WithDebugInfo >::HasDebugInformation = WithDebugInfo
staticconstexpr

◆ SizeNotTracked

template<bool WithDebugInfo>
ice::usize ice::AllocatorBase< WithDebugInfo >::SizeNotTracked = { static_cast<ice::usize::base_type>(0xFFFFEEEE'EEEEFFFF) }
staticconstexpr

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