MCPcopy Create free account
hub / github.com/apache/kvrocks / EncodeFixed

Function EncodeFixed

src/common/encoding.h:47–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46template <typename T>
47constexpr char *EncodeFixed(char *buf, T value) {
48 if constexpr (IsLittleEndian()) {
49 value = BitSwap(value);
50 }
51 __builtin_memcpy(buf, &value, sizeof(value));
52 return buf + sizeof(value);
53}
54
55inline char *EncodeFixed8(char *buf, uint8_t value) { return EncodeFixed(buf, value); }
56inline char *EncodeFixed16(char *buf, uint16_t value) { return EncodeFixed(buf, value); }

Callers 5

EncodeFixed8Function · 0.85
EncodeFixed16Function · 0.85
EncodeFixed32Function · 0.85
EncodeFixed64Function · 0.85
PutFixedFunction · 0.85

Calls 2

IsLittleEndianFunction · 0.85
BitSwapFunction · 0.85

Tested by

no test coverage detected