| 81 | } |
| 82 | |
| 83 | void static inline WriteBE64(unsigned char* ptr, uint64_t x) |
| 84 | { |
| 85 | uint64_t v = htobe64(x); |
| 86 | memcpy(ptr, (char*)&v, 8); |
| 87 | } |
| 88 | |
| 89 | /** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */ |
| 90 | uint64_t static inline CountBits(uint64_t x) |