Closed
Bug 1563425
Opened 5 years ago
Closed 5 years ago
Implement basic circular byte buffer with iterator and LEB128 helpers
Categories
(Core :: Gecko Profiler, task, P2)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla70
People
(Reporter: mozbugz, Assigned: mozbugz)
References
Details
Attachments
(1 file)
The new ProfileBuffer underlying buffer will store variable-sized entries in a circular buffer.
That fancy circular buffer will itself use an underlying circular byte buffer, to better separate responsibilities.
Assignee | ||
Comment 1•5 years ago
|
||
Basic usage: (Silly examples)
- Create buffer:
ModuloBuffer mb(PowerOfTwo);
- Get iterator:
auto writer = mb.WriterAt(Index);
(orReaderAt()
) - Basic iterator functions on bytes:
*++writer = 'x';
- Write:
writer.WriteULEB128(sizeof(int)); writer.WriteObject<int>(42);
- Comparisons, move:
while (writer > reader) { --writer; }
- Read:
size_t s = reader.ReadLEB128<size_t>(); int i = ReadObject<int>();
There are no safety checks, it will be up to the caller to ensure thread-safety,
and data safety when wrapping around the buffer.
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3f48535246db ModuloBuffer is a basic circular byte buffer with iterator and LEB128 helpers - r=gregtatum
Comment 3•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox70:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Updated•5 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•