diff options
Diffstat (limited to 'runtime/base/bit_vector.h')
-rw-r--r-- | runtime/base/bit_vector.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h index be4d363bf5..6e4367ac9d 100644 --- a/runtime/base/bit_vector.h +++ b/runtime/base/bit_vector.h @@ -20,6 +20,8 @@ #include <stdint.h> #include <iterator> +#include "utils.h" + namespace art { class Allocator; @@ -116,6 +118,11 @@ class BitVector { virtual ~BitVector(); + // The number of words necessary to encode bits. + static constexpr uint32_t BitsToWords(uint32_t bits) { + return RoundUp(bits, kWordBits) / kWordBits; + } + // Mark the specified bit as "set". void SetBit(uint32_t idx) { /* |