GRPC C++  1.62.0
Public Member Functions
grpc_event_engine::experimental::internal::MemoryAllocatorImpl Class Referenceabstract

Underlying memory allocation interface. More...

#include <memory_allocator_impl.h>

Public Member Functions

 MemoryAllocatorImpl ()
 
virtual ~MemoryAllocatorImpl ()
 
 MemoryAllocatorImpl (const MemoryAllocatorImpl &)=delete
 
MemoryAllocatorImploperator= (const MemoryAllocatorImpl &)=delete
 
virtual size_t Reserve (MemoryRequest request)=0
 Reserve bytes from the quota. More...
 
virtual grpc_slice MakeSlice (MemoryRequest request)=0
 Allocate a slice, using MemoryRequest to size the number of returned bytes. More...
 
virtual void Release (size_t n)=0
 Release some bytes that were previously reserved. More...
 
virtual void Shutdown ()=0
 Shutdown this allocator. More...
 

Detailed Description

Underlying memory allocation interface.

This is an internal interface, not intended to be used by users. Its interface is subject to change at any time.

Constructor & Destructor Documentation

◆ MemoryAllocatorImpl() [1/2]

grpc_event_engine::experimental::internal::MemoryAllocatorImpl::MemoryAllocatorImpl ( )
inline

◆ ~MemoryAllocatorImpl()

virtual grpc_event_engine::experimental::internal::MemoryAllocatorImpl::~MemoryAllocatorImpl ( )
inlinevirtual

◆ MemoryAllocatorImpl() [2/2]

grpc_event_engine::experimental::internal::MemoryAllocatorImpl::MemoryAllocatorImpl ( const MemoryAllocatorImpl )
delete

Member Function Documentation

◆ MakeSlice()

virtual grpc_slice grpc_event_engine::experimental::internal::MemoryAllocatorImpl::MakeSlice ( MemoryRequest  request)
pure virtual

Allocate a slice, using MemoryRequest to size the number of returned bytes.

For a variable length request, check the returned slice length to verify how much memory was allocated. Takes care of reserving memory for any relevant control structures also.

◆ operator=()

MemoryAllocatorImpl& grpc_event_engine::experimental::internal::MemoryAllocatorImpl::operator= ( const MemoryAllocatorImpl )
delete

◆ Release()

virtual void grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Release ( size_t  n)
pure virtual

Release some bytes that were previously reserved.

If more bytes are released than were reserved, we will have undefined behavior.

◆ Reserve()

virtual size_t grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Reserve ( MemoryRequest  request)
pure virtual

Reserve bytes from the quota.

If we enter overcommit, reclamation will begin concurrently. Returns the number of bytes reserved. If MemoryRequest is invalid, this function will abort. If MemoryRequest is valid, this function is infallible, and will always succeed at reserving the some number of bytes between request.min() and request.max() inclusively.

◆ Shutdown()

virtual void grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Shutdown ( )
pure virtual

Shutdown this allocator.

Further usage of Reserve() is undefined behavior.


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