| 48 | } |
| 49 | |
| 50 | inline 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 | |
| 65 | inline void bits_to_indexes_helper(uint64_t word, uint16_t base_index, int* num_indexes, |
| 66 | uint16_t* indexes) { |
no test coverage detected