Computes a hash function of Value and sets the corresponding bit. Returns true if the bit was changed from 0 to 1.
| 30 | // Computes a hash function of Value and sets the corresponding bit. |
| 31 | // Returns true if the bit was changed from 0 to 1. |
| 32 | ATTRIBUTE_NO_SANITIZE_ALL |
| 33 | inline bool AddValue(uintptr_t Value) { |
| 34 | uintptr_t Idx = Value % kMapSizeInBits; |
| 35 | uintptr_t WordIdx = Idx / kBitsInWord; |
| 36 | uintptr_t BitIdx = Idx % kBitsInWord; |
| 37 | uintptr_t Old = Map[WordIdx]; |
| 38 | uintptr_t New = Old | (1ULL << BitIdx); |
| 39 | Map[WordIdx] = New; |
| 40 | return New != Old; |
| 41 | } |
| 42 | |
| 43 | ATTRIBUTE_NO_SANITIZE_ALL |
| 44 | inline bool AddValueModPrime(uintptr_t Value) { |
no outgoing calls
no test coverage detected