roundUpPower2 rounds a number to the next power of 2.
(i uintptr)
| 11 | |
| 12 | // roundUpPower2 rounds a number to the next power of 2. |
| 13 | func roundUpPower2(i uintptr) uintptr { |
| 14 | i-- |
| 15 | i |= i >> 1 |
| 16 | i |= i >> 2 |
| 17 | i |= i >> 4 |
| 18 | i |= i >> 8 |
| 19 | i |= i >> 16 |
| 20 | i |= i >> 32 |
| 21 | i++ |
| 22 | return i |
| 23 | } |
| 24 | |
| 25 | // log2 computes the binary logarithm of x, rounded up to the next integer. |
| 26 | func log2(i uintptr) uintptr { |
no outgoing calls
no test coverage detected
searching dependent graphs…