| 47 | } |
| 48 | |
| 49 | inline static int test_bit(uint8_t *bf, uint64_t bit) |
| 50 | { |
| 51 | uint64_t byte = bit >> 3; |
| 52 | uint8_t c = bf[byte]; // expensive memory access |
| 53 | uint8_t mask = 1 << (bit % 8); |
| 54 | if (c & mask) { |
| 55 | return 1; |
| 56 | } else { |
| 57 | return 0; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static int bloom_check_add(struct bloom * bloom, const void * buffer, int len, int add) |
| 62 | { |