memory_allocator_impl.h
Go to the documentation of this file.
1 // Copyright 2021 The gRPC Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
15 #define GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
16 
18 
19 #include <algorithm>
20 #include <memory>
21 #include <type_traits>
22 #include <vector>
23 
25 #include <grpc/slice.h>
26 
27 namespace grpc_event_engine {
28 namespace experimental {
29 
30 namespace internal {
31 
36  : public std::enable_shared_from_this<MemoryAllocatorImpl> {
37  public:
39  virtual ~MemoryAllocatorImpl() {}
40 
43 
51  virtual size_t Reserve(MemoryRequest request) = 0;
52 
56  virtual void Release(size_t n) = 0;
57 
60  virtual void Shutdown() = 0;
61 };
62 
63 } // namespace internal
64 
65 } // namespace experimental
66 } // namespace grpc_event_engine
67 
68 #endif // GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
slice.h
benchmark.request
request
Definition: benchmark.py:77
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::operator=
MemoryAllocatorImpl & operator=(const MemoryAllocatorImpl &)=delete
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::~MemoryAllocatorImpl
virtual ~MemoryAllocatorImpl()
Definition: memory_allocator_impl.h:39
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::MemoryAllocatorImpl
MemoryAllocatorImpl()
Definition: memory_allocator_impl.h:38
memory_request.h
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Shutdown
virtual void Shutdown()=0
port_platform.h
grpc_event_engine
Definition: endpoint_config.h:24
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Reserve
virtual size_t Reserve(MemoryRequest request)=0
grpc_event_engine::experimental::internal::MemoryAllocatorImpl::Release
virtual void Release(size_t n)=0
internal
Definition: benchmark/test/output_test_helper.cc:20
grpc_event_engine::experimental::internal::MemoryAllocatorImpl
Definition: memory_allocator_impl.h:35
grpc_event_engine::experimental::MemoryRequest
Reservation request - how much memory do we want to allocate?
Definition: memory_request.h:27


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:35