#include <memory_allocator.h>
◆ MemoryAllocator() [1/4]
◆ MemoryAllocator() [2/4]
grpc_event_engine::experimental::MemoryAllocator::MemoryAllocator |
( |
| ) |
|
|
inline |
◆ ~MemoryAllocator()
grpc_event_engine::experimental::MemoryAllocator::~MemoryAllocator |
( |
| ) |
|
|
inline |
◆ MemoryAllocator() [3/4]
grpc_event_engine::experimental::MemoryAllocator::MemoryAllocator |
( |
const MemoryAllocator & |
| ) |
|
|
delete |
◆ MemoryAllocator() [4/4]
grpc_event_engine::experimental::MemoryAllocator::MemoryAllocator |
( |
MemoryAllocator && |
| ) |
|
|
default |
◆ get_internal_impl_ptr() [1/2]
Return a pointer to the underlying implementation.
Note that the interface of said implementation is unstable and likely to change at any time.
◆ get_internal_impl_ptr() [2/2]
◆ MakeReservation()
Reserve bytes from the quota and automatically release them when Reservation is destroyed.
◆ MakeSlice()
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.
◆ MakeUnique()
template<typename T , typename... Args>
std::unique_ptr<T> grpc_event_engine::experimental::MemoryAllocator::MakeUnique |
( |
Args &&... |
args | ) |
|
|
inline |
Construct a unique_ptr immediately.
◆ New()
template<typename T , typename... Args>
std::enable_if<std::has_virtual_destructor<T>::value, T*>::type grpc_event_engine::experimental::MemoryAllocator::New |
( |
Args &&... |
args | ) |
|
|
inline |
Allocate a new object of type T, with constructor arguments.
The returned type is wrapped, and upon destruction the reserved memory will be released to the allocator automatically. As such, T must have a virtual destructor so we can insert the necessary hook.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Release()
void grpc_event_engine::experimental::MemoryAllocator::Release |
( |
size_t |
n | ) |
|
|
inline |
Release some bytes that were previously reserved.
◆ Reserve()
size_t grpc_event_engine::experimental::MemoryAllocator::Reserve |
( |
MemoryRequest |
request | ) |
|
|
inline |
Reserve bytes from the quota.
If we enter overcommit, reclamation will begin concurrently. Returns the number of bytes reserved.
◆ Reset()
void grpc_event_engine::experimental::MemoryAllocator::Reset |
( |
| ) |
|
|
inline |
Drop the underlying allocator and make this an empty object.
The object will not be usable after this call unless it's a valid allocator is moved into it.
The documentation for this class was generated from the following file: