class MessageArena

Defined at line 40 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

Object allocator for fixed-sized protozero::Message objects.

It's a simple bump-pointer allocator which leverages the stack-alike

usage pattern of protozero nested messages. It avoids hitting the system

allocator in most cases, by reusing the same block, and falls back on

allocating new blocks only when using deeply nested messages (which are

extremely rare).

This is used by RootMessage

<T

> to handle the storage for root-level messages.

Public Methods

void MessageArena ()
void MessageArena (const MessageArena & )

Strictly no copies or moves as this is used to hand out pointers.

Defined at line 46 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

MessageArena & operator= (const MessageArena & )

Defined at line 47 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

void MessageArena (MessageArena && )

Defined at line 48 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

MessageArena & operator= (MessageArena && )

Defined at line 49 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

void DeleteLastMessage (Message * msg)

Deletes the last message allocated. The |msg| argument is used only for

DCHECKs, it MUST be the pointer obtained by the last NewMessage() call.

Defined at line 56 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h

void ~MessageArena ()
Message * NewMessage ()

Allocates a new Message object.

void Reset ()

Resets the state of the arena, clearing up all but one block. This is used

to avoid leaking outstanding unfinished sub-messages while recycling the

RootMessage object (this is extremely rare due to the RAII scoped handles

but could happen if some client does some overly clever std::move() trick).

Defined at line 67 of file ../../third_party/perfetto/include/perfetto/protozero/message_arena.h