MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / BufferExtent

Class BufferExtent

runtime/Log.h:264–292  ·  view source on GitHub ↗

* Marker in the compressed log that indicates to which StagingBuffer/thread * the next contiguous chunk of LOG_MSG's belong to (up to the next * BufferExtent marker). These markers correspond to when the compression * thread finishes processing a peek() and moves on to outputting the next * StagingBuffer. */

Source from the content-addressed store, hash-verified

262 * StagingBuffer.
263 */
264 struct BufferExtent {
265 // Byte representation of EntryType::BUFFER_EXTENT
266 uint8_t entryType:2;
267
268 // Indicates that the BufferChange also corresponds with a complete
269 // pass through all the StagingBuffers at runtime. This information can
270 // be used to determine the maximal temporal reordering that can occur
271 // in the linear compressed log.
272 uint8_t wrapAround:1;
273
274 // A value of 1 indicates the next 4 bits are a threadId, else
275 // the next 4 bits are the 4-bit result of a pack() operation.
276 uint8_t isShort:1;
277
278 // Value is either a 4-bit threadId or a Pack() result used to compact
279 // the thread id that comes after this header.
280 uint8_t threadIdOrPackNibble:4;
281
282 // Indicates the byte size of the extent. This value is purposely
283 // left unpack()-ed in-order to allow for delayed assignment (i.e.
284 // after all the log messages have been processed).
285 uint32_t length;
286
287 // Returns the maximum size the BufferChange structure can be with
288 // the Pack()-ed arguments.
289 static constexpr uint32_t maxSizeOfHeader() {
290 return sizeof(BufferExtent) + sizeof(uint32_t);
291 }
292 } __attribute__((packed));
293
294 /**
295 * Synchronization data structure in the compressed log that correlates the

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected