Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
google::protobuf.internal::SerialArena Class Reference

#include <arena_impl.h>

Classes

struct  Block
 
struct  CleanupNode
 
struct  Memory
 

Public Member Functions

void AddCleanup (void *elem, void(*cleanup)(void *), const AllocationPolicy *policy)
 
void * AllocateAligned (size_t n, const AllocationPolicy *policy)
 
std::pair< void *, CleanupNode * > AllocateAlignedWithCleanup (size_t n, const AllocationPolicy *policy)
 
void CleanupList ()
 
bool HasSpace (size_t n)
 
bool MaybeAllocateAligned (size_t n, void **out)
 
SerialArenanext () const
 
void * owner () const
 
void set_next (SerialArena *next)
 
uint64_t SpaceAllocated () const
 
uint64_t SpaceUsed () const
 

Static Public Attributes

static constexpr size_t kBlockHeaderSize = AlignUpTo8(sizeof(Block))
 
static constexpr size_t kCleanupSize = AlignUpTo8(sizeof(CleanupNode))
 

Private Member Functions

void * AllocateAlignedFallback (size_t n, const AllocationPolicy *policy)
 
std::pair< void *, CleanupNode * > AllocateAlignedWithCleanupFallback (size_t n, const AllocationPolicy *policy)
 
void * AllocateFromExisting (size_t n)
 
std::pair< void *, CleanupNode * > AllocateFromExistingWithCleanupFallback (size_t n)
 
void AllocateNewBlock (size_t n, const AllocationPolicy *policy)
 
std::pair< void *, CleanupNode * > CreatePair (void *ptr, CleanupNode *node)
 
template<typename Deallocator >
Memory Free (Deallocator deallocator)
 
 SerialArena (Block *b, void *owner)
 

Static Private Member Functions

static SerialArenaNew (SerialArena::Memory mem, void *owner)
 

Private Attributes

Blockhead_
 
char * limit_
 
SerialArenanext_
 
void * owner_
 
char * ptr_
 
std::atomic< size_t > space_allocated_
 
size_t space_used_ = 0
 

Friends

class ArenaBenchmark
 
class ThreadSafeArena
 

Detailed Description

Definition at line 191 of file protobuf/src/google/protobuf/arena_impl.h.

Constructor & Destructor Documentation

◆ SerialArena()

google::protobuf.internal::SerialArena::SerialArena ( Block b,
void *  owner 
)
inlineprivate

Member Function Documentation

◆ AddCleanup()

void google::protobuf.internal::SerialArena::AddCleanup ( void *  elem,
void(*)(void *)  cleanup,
const AllocationPolicy policy 
)
inline

Definition at line 265 of file protobuf/src/google/protobuf/arena_impl.h.

◆ AllocateAligned()

void* google::protobuf.internal::SerialArena::AllocateAligned ( size_t  n,
const AllocationPolicy policy 
)
inline

Definition at line 213 of file protobuf/src/google/protobuf/arena_impl.h.

◆ AllocateAlignedFallback()

PROTOBUF_NOINLINE void * google::protobuf.internal::SerialArena::AllocateAlignedFallback ( size_t  n,
const AllocationPolicy policy 
)
private

◆ AllocateAlignedWithCleanup()

std::pair<void*, CleanupNode*> google::protobuf.internal::SerialArena::AllocateAlignedWithCleanup ( size_t  n,
const AllocationPolicy policy 
)
inline

Definition at line 242 of file protobuf/src/google/protobuf/arena_impl.h.

◆ AllocateAlignedWithCleanupFallback()

PROTOBUF_NOINLINE std::pair< void *, SerialArena::CleanupNode * > google::protobuf.internal::SerialArena::AllocateAlignedWithCleanupFallback ( size_t  n,
const AllocationPolicy policy 
)
private

◆ AllocateFromExisting()

void* google::protobuf.internal::SerialArena::AllocateFromExisting ( size_t  n)
inlineprivate

Definition at line 223 of file protobuf/src/google/protobuf/arena_impl.h.

◆ AllocateFromExistingWithCleanupFallback()

std::pair<void*, CleanupNode*> google::protobuf.internal::SerialArena::AllocateFromExistingWithCleanupFallback ( size_t  n)
inlineprivate

Definition at line 252 of file protobuf/src/google/protobuf/arena_impl.h.

◆ AllocateNewBlock()

void google::protobuf.internal::SerialArena::AllocateNewBlock ( size_t  n,
const AllocationPolicy policy 
)
private

◆ CleanupList()

void google::protobuf.internal::SerialArena::CleanupList ( )

◆ CreatePair()

std::pair<void*, CleanupNode*> google::protobuf.internal::SerialArena::CreatePair ( void *  ptr,
CleanupNode node 
)
inlineprivate

Definition at line 322 of file protobuf/src/google/protobuf/arena_impl.h.

◆ Free()

template<typename Deallocator >
SerialArena::Memory google::protobuf.internal::SerialArena::Free ( Deallocator  deallocator)
private

◆ HasSpace()

bool google::protobuf.internal::SerialArena::HasSpace ( size_t  n)
inline

Definition at line 211 of file protobuf/src/google/protobuf/arena_impl.h.

◆ MaybeAllocateAligned()

bool google::protobuf.internal::SerialArena::MaybeAllocateAligned ( size_t  n,
void **  out 
)
inline

Definition at line 234 of file protobuf/src/google/protobuf/arena_impl.h.

◆ New()

SerialArena * google::protobuf.internal::SerialArena::New ( SerialArena::Memory  mem,
void *  owner 
)
staticprivate

◆ next()

SerialArena* google::protobuf.internal::SerialArena::next ( ) const
inline

Definition at line 273 of file protobuf/src/google/protobuf/arena_impl.h.

◆ owner()

void* google::protobuf.internal::SerialArena::owner ( ) const
inline

Definition at line 272 of file protobuf/src/google/protobuf/arena_impl.h.

◆ set_next()

void google::protobuf.internal::SerialArena::set_next ( SerialArena next)
inline

Definition at line 274 of file protobuf/src/google/protobuf/arena_impl.h.

◆ SpaceAllocated()

uint64_t google::protobuf.internal::SerialArena::SpaceAllocated ( ) const
inline

Definition at line 206 of file protobuf/src/google/protobuf/arena_impl.h.

◆ SpaceUsed()

uint64_t google::protobuf.internal::SerialArena::SpaceUsed ( ) const

Friends And Related Function Documentation

◆ ArenaBenchmark

friend class ArenaBenchmark
friend

Definition at line 278 of file protobuf/src/google/protobuf/arena_impl.h.

◆ ThreadSafeArena

friend class ThreadSafeArena
friend

Definition at line 277 of file protobuf/src/google/protobuf/arena_impl.h.

Member Data Documentation

◆ head_

Block* google::protobuf.internal::SerialArena::head_
private

Definition at line 304 of file protobuf/src/google/protobuf/arena_impl.h.

◆ kBlockHeaderSize

constexpr size_t google::protobuf.internal::SerialArena::kBlockHeaderSize = AlignUpTo8(sizeof(Block))
staticconstexpr

Definition at line 327 of file protobuf/src/google/protobuf/arena_impl.h.

◆ kCleanupSize

constexpr size_t google::protobuf.internal::SerialArena::kCleanupSize = AlignUpTo8(sizeof(CleanupNode))
staticconstexpr

Definition at line 328 of file protobuf/src/google/protobuf/arena_impl.h.

◆ limit_

char* google::protobuf.internal::SerialArena::limit_
private

Definition at line 313 of file protobuf/src/google/protobuf/arena_impl.h.

◆ next_

SerialArena* google::protobuf.internal::SerialArena::next_
private

Definition at line 305 of file protobuf/src/google/protobuf/arena_impl.h.

◆ owner_

void* google::protobuf.internal::SerialArena::owner_
private

Definition at line 303 of file protobuf/src/google/protobuf/arena_impl.h.

◆ ptr_

char* google::protobuf.internal::SerialArena::ptr_
private

Definition at line 312 of file protobuf/src/google/protobuf/arena_impl.h.

◆ space_allocated_

std::atomic<size_t> google::protobuf.internal::SerialArena::space_allocated_
private

Definition at line 307 of file protobuf/src/google/protobuf/arena_impl.h.

◆ space_used_

size_t google::protobuf.internal::SerialArena::space_used_ = 0
private

Definition at line 306 of file protobuf/src/google/protobuf/arena_impl.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:26