Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::core::NoopArenaImpl Class Reference

Arena implementation that just fails all allocations. Can be used with containers that have embedded capacity and arena, but we want them to use only embedded capacity. More...

#include <noop_arena.h>

Inheritance diagram for roc::core::NoopArenaImpl:
roc::core::IArena roc::core::NonCopyable< Tag >

Public Member Functions

virtual void * allocate (size_t size)
 Allocate memory no-op.
 
virtual void deallocate (void *ptr)
 Deallocate memory no-op.
 
virtual size_t compute_allocated_size (size_t size) const
 Compute allocated size no-op.
 
virtual size_t allocated_size (void *ptr) const
 Allocated size given pointer no-op.
 
- Public Member Functions inherited from roc::core::IArena
virtual void * allocate (size_t size)=0
 Allocate memory.
 
virtual void deallocate (void *ptr)=0
 Deallocate previously allocated memory.
 
virtual size_t compute_allocated_size (size_t size) const =0
 Computes how many bytes will be actually allocated if allocate() is called with given size. Covers all internal overhead, if any.
 
virtual size_t allocated_size (void *ptr) const =0
 Returns how many bytes was allocated for given pointer returned by allocate(). Covers all internal overhead, if any. Returns same value as computed by compute_allocated_size(size).
 
template<class T >
void destroy_object (T &object)
 Destroy object and deallocate its memory.
 

Detailed Description

Arena implementation that just fails all allocations. Can be used with containers that have embedded capacity and arena, but we want them to use only embedded capacity.

Definition at line 24 of file noop_arena.h.

Member Function Documentation

◆ allocate()

virtual void * roc::core::NoopArenaImpl::allocate ( size_t  size)
virtual

Allocate memory no-op.

Returns
Always returns null.

Implements roc::core::IArena.

◆ allocated_size()

virtual size_t roc::core::NoopArenaImpl::allocated_size ( void *  ptr) const
virtual

Allocated size given pointer no-op.

Returns
Always 0.

Implements roc::core::IArena.

◆ compute_allocated_size()

virtual size_t roc::core::NoopArenaImpl::compute_allocated_size ( size_t  size) const
virtual

Compute allocated size no-op.

Returns
Always 0.

Implements roc::core::IArena.

◆ deallocate()

virtual void roc::core::NoopArenaImpl::deallocate ( void *  ptr)
virtual

Deallocate memory no-op.

Implements roc::core::IArena.


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