#include <memory_allocator.h>
Definition at line 35 of file 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]
◆ 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.
Definition at line 174 of file memory_allocator.h.
◆ get_internal_impl_ptr() [2/2]
◆ MakeReservation()
◆ 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.
Definition at line 61 of file memory_allocator.cc.
◆ MakeUnique()
template<typename T , typename... Args>
std::unique_ptr<T> grpc_event_engine::experimental::MemoryAllocator::MakeUnique |
( |
Args &&... |
args | ) |
|
|
inline |
◆ 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.
Definition at line 109 of file memory_allocator.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Release()
void grpc_event_engine::experimental::MemoryAllocator::Release |
( |
size_t |
n | ) |
|
|
inline |
◆ 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.
Definition at line 66 of file memory_allocator.h.
◆ 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.
Definition at line 58 of file memory_allocator.h.
◆ allocator_
The documentation for this class was generated from the following files: