MySQL 8.4.2
Source Code Documentation
|
This class is used for storing unstructured optimizer trace text (as used by the Hypergraph optimizer). More...
#include <optimizer_trace.h>
Public Member Functions | |
int_type | overflow (int_type ch) override |
Called by std::ostream if the current segment is full. More... | |
template<typename Sink > | |
void | ForEach (Sink sink) const |
Apply 'sink' to each character in the trace text. More... | |
template<typename Sink > | |
void | ForEachRemove (Sink sink) |
Apply 'sink' to each character in the trace text. More... | |
std::string | ToString () const |
Return a copy of the contents as a string. More... | |
Static Public Attributes | |
static constexpr size_t | kSegmentSize = 4096 |
The size of each consecutive buffer. More... | |
Private Types | |
using | Segment = std::array< char, kSegmentSize > |
A consecutive buffer. More... | |
using | DequeType = std::deque< Segment > |
The sequence of consecutive buffers. More... | |
Private Attributes | |
DequeType | m_segments |
The sequence of segments. More... | |
This class is used for storing unstructured optimizer trace text (as used by the Hypergraph optimizer).
It is used as the std::streambuf object of an associated std::ostream (which writes the formatted text into a TraceBuffer object). The text is stored in a non-consecutive sequence of segments, where each segment has a chunk of consecutive memory. That way, the buffer can grow without having to copy the text into ever bigger buffers of consecutive memory.
|
private |
The sequence of consecutive buffers.
|
private |
A consecutive buffer.
|
inline |
Apply 'sink' to each character in the trace text.
|
inline |
Apply 'sink' to each character in the trace text.
Free each segment when its contents have been consumed.
|
inlineoverride |
Called by std::ostream if the current segment is full.
Allocate a new segment and put 'ch' at the beginning of it.
|
inline |
Return a copy of the contents as a string.
This may be expensive for large traces, and is only intended for unit tests.
|
staticconstexpr |
The size of each consecutive buffer.
|
private |
The sequence of segments.