class ScatteredHeapBuffer

Defined at line 33 of file ../../third_party/perfetto/include/perfetto/protozero/scattered_heap_buffer.h

Public Methods

void ScatteredHeapBuffer (size_t initial_slice_size_bytes, size_t maximum_slice_size_bytes)
void ~ScatteredHeapBuffer ()
protozero::ContiguousMemoryRange GetNewBuffer ()

protozero::ScatteredStreamWriter::Delegate implementation.

const std::vector<Slice> & GetSlices ()

Return the slices backing this buffer, adjusted for the number of bytes the

writer has written.

std::vector<uint8_t> StitchSlices ()

Stitch all the slices into a single contiguous buffer.

std::pair<std::unique_ptr<uint8_t[]>, size_t> StitchAsUniquePtr ()

Stitch all the slices into a contiguous output buffer.

std::vector<protozero::ContiguousMemoryRange> GetRanges ()

Note that the returned ranges point back to this buffer and thus cannot

outlive it.

void AdjustUsedSizeOfCurrentSlice ()

Update unused_bytes() of the current |Slice| based on the writer's state.

size_t GetTotalSize ()

Returns the total size the slices occupy in heap memory (including unused).

void Reset ()

Reset the contents of this buffer but retain one slice allocation (if it

exists) to be reused for future writes.

const std::vector<Slice> & slices ()

Note that size of the last slice isn't updated to reflect the number of

bytes written by the trace writer.

Defined at line 91 of file ../../third_party/perfetto/include/perfetto/protozero/scattered_heap_buffer.h

void set_writer (protozero::ScatteredStreamWriter * writer)

Defined at line 93 of file ../../third_party/perfetto/include/perfetto/protozero/scattered_heap_buffer.h

Records