GRPC C++
1.62.0
|
Underlying memory allocation interface. More...
#include <memory_allocator_impl.h>
Public Member Functions | |
MemoryAllocatorImpl () | |
virtual | ~MemoryAllocatorImpl () |
MemoryAllocatorImpl (const MemoryAllocatorImpl &)=delete | |
MemoryAllocatorImpl & | operator= (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... | |
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.
|
inline |
|
inlinevirtual |
|
delete |
|
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.
|
delete |
|
pure virtual |
Release some bytes that were previously reserved.
If more bytes are released than were reserved, we will have undefined behavior.
|
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.
|
pure virtual |
Shutdown this allocator.
Further usage of Reserve() is undefined behavior.