MCPcopy Create free account
hub / github.com/deepseek-ai/3FS / EncodeFixed64

Function EncodeFixed64

src/common/utils/coding.h:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61inline void EncodeFixed64(char *dst, uint64_t value) {
62 uint8_t *const buffer = reinterpret_cast<uint8_t *>(dst);
63
64 // Recent clang and gcc optimize this to a single mov / str instruction.
65 buffer[0] = static_cast<uint8_t>(value);
66 buffer[1] = static_cast<uint8_t>(value >> 8);
67 buffer[2] = static_cast<uint8_t>(value >> 16);
68 buffer[3] = static_cast<uint8_t>(value >> 24);
69 buffer[4] = static_cast<uint8_t>(value >> 32);
70 buffer[5] = static_cast<uint8_t>(value >> 40);
71 buffer[6] = static_cast<uint8_t>(value >> 48);
72 buffer[7] = static_cast<uint8_t>(value >> 56);
73}
74
75// Lower-level versions of Get... that read directly from a character buffer
76// without any bounds checking.

Callers 1

PutFixed64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected