Estd Allocator#

class ISafeMemAllocator#

Byte allocator backend, also replaceable by a tracking or fault-injection implementation. Tracking backends and their associated containers are for single-threaded debug/test use. The backend must outlive every allocator copy and container using it.

Subclassed by trt_edgellm::safety::SafetyContainerStorage

Public Functions

virtual ~ISafeMemAllocator() = default#
virtual void *allocate(
std::size_t sizeInBytes,
std::size_t alignment
) = 0#
virtual void deallocate(
void *input,
std::size_t sizeInBytes,
std::size_t alignment
) noexcept = 0#
class ControlledHostAllocGetter#

Process-wide default for subsequently constructed allocators. Call setInternal/reset during setup or teardown with no concurrent allocator access.

Public Static Functions

static ISafeMemAllocator *get() noexcept#

Returns the configured allocator, initially the host heap allocator.

static void setInternal(ISafeMemAllocator *allocator) noexcept#

Configure during initialization or test setup; nullptr restores the host heap. The allocator must outlive all captured bindings. Existing bindings are unchanged.

static void reset() noexcept#
template<typename T>
class allocator#

STL allocator that captures the default at construction, or accepts an explicit allocator.

Public Types

using value_type = T#
using size_type = std::size_t#
using difference_type = std::ptrdiff_t#
using propagate_on_container_move_assignment = std::true_type#
using propagate_on_container_swap = std::true_type#
using is_always_equal = std::false_type#

Public Functions

inline allocator() noexcept#
inline explicit allocator(ISafeMemAllocator &memAllocator) noexcept#
template<typename U>
inline allocator(
allocator<U> const &other
) noexcept#
inline T *allocate(size_type count)#
inline void deallocate(T *input, size_type count) noexcept#
inline size_type max_size() const noexcept#
inline ISafeMemAllocator &getMemAllocator() const noexcept#

Returns the captured backend shared by allocator copies and rebinds.

template<typename U>
inline bool operator==(
allocator<U> const &other
) const noexcept#
template<typename U>
inline bool operator!=(
allocator<U> const &other
) const noexcept#
template<typename U>
struct rebind#

Public Types

using other = allocator<U>#
template<typename U>
struct rebind

Public Types

using other = allocator<U>