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

Function EncodeFixed32

src/common/utils/coding.h:51–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49// REQUIRES: dst has enough space for the value being written
50
51inline void EncodeFixed32(char *dst, uint32_t value) {
52 uint8_t *const buffer = reinterpret_cast<uint8_t *>(dst);
53
54 // Recent clang and gcc optimize this to a single mov / str instruction.
55 buffer[0] = static_cast<uint8_t>(value);
56 buffer[1] = static_cast<uint8_t>(value >> 8);
57 buffer[2] = static_cast<uint8_t>(value >> 16);
58 buffer[3] = static_cast<uint8_t>(value >> 24);
59}
60
61inline void EncodeFixed64(char *dst, uint64_t value) {
62 uint8_t *const buffer = reinterpret_cast<uint8_t *>(dst);

Callers 1

PutFixed32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected