MCPcopy Create free account
hub / github.com/apache/arrow / SafeStoreUpTo8Bytes

Function SafeStoreUpTo8Bytes

cpp/src/arrow/compute/util.cc:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50inline void SafeStoreUpTo8Bytes(uint8_t* bytes, int num_bytes, uint64_t value) {
51 // This will not be correct on big-endian architectures.
52#if !ARROW_LITTLE_ENDIAN
53 ARROW_DCHECK(false);
54#endif
55 ARROW_DCHECK(num_bytes >= 0 && num_bytes <= 8);
56 if (num_bytes == 8) {
57 util::SafeStore(reinterpret_cast<uint64_t*>(bytes), value);
58 } else {
59 for (int i = 0; i < num_bytes; ++i) {
60 bytes[i] = static_cast<uint8_t>(value >> (8 * i));
61 }
62 }
63}
64
65inline void bits_to_indexes_helper(uint64_t word, uint16_t base_index, int* num_indexes,
66 uint16_t* indexes) {

Callers 1

bits_to_bytesFunction · 0.85

Calls 1

SafeStoreFunction · 0.85

Tested by

no test coverage detected