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

Function decompressLogHeader

runtime/Log.h:548–567  ·  view source on GitHub ↗

* Read in and decompress the log metadata from a CompressedRecordEntry * * \param in * Character array to read the entry from * \param lastTimestamp * Timestamp of the previous entry dencoded before this one * \param[out] logid * The logId decoded * \param[out] timestamp * The timestamp decoded * \return * true indicat

Source from the content-addressed store, hash-verified

546 * encode a CompressedRecordEntry
547 */
548 inline bool
549 decompressLogHeader(const char **in, uint64_t lastTimestamp,
550 uint32_t &logId, uint64_t &timestamp) {
551 if (!(reinterpret_cast<const UnknownHeader*>(*in)->entryType
552 == EntryType::LOG_MSGS_OR_DIC))
553 return false;
554
555 CompressedEntry cre;
556 memcpy(&cre, (*in), sizeof(CompressedEntry));
557 (*in) += sizeof(CompressedEntry);
558
559 logId = BufferUtils::unpack<uint32_t>(in,
560 static_cast<uint8_t>(cre.additionalFmtIdBytes + 1));
561 timestamp = BufferUtils::unpack<int64_t>(in,
562 static_cast<uint8_t>(cre.additionalTimestampBytes));
563
564 timestamp += lastTimestamp;
565
566 return true;
567 }
568
569
570 bool insertCheckpoint(char** out,

Callers 3

readBufferExtentMethod · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68