Lines Matching refs:BITS
39 // the bits every time.
41 // The BITS parameter should be the number of bits required to hold
43 // page offset fits in lower 12 bits), BITS == 20.
68 template <int BITS>
71 static const int LENGTH = 1 << BITS;
79 array_ = reinterpret_cast<void**>((*allocator)(sizeof(void*) << BITS));
80 memset(array_, 0, sizeof(void*) << BITS);
98 if ((k >> BITS) > 0) {
104 // REQUIRES "k" is in range "[0,2^BITS-1]".
115 while (k < (1 << BITS)) {
130 template <int BITS>
134 static const int LENGTH = 1 << BITS;
142 // Note that 2^3 = 8 bits per char, and hence the use of the magical "3" in
144 char committed_[sizeof(void*) << (BITS - kPageShift - 3)];
169 size_t size = sizeof(*array_) << BITS;
185 // then we'll set some of the bits in committed_ to remember this fact.
186 // Only the bits of committed_ near end-points for calls to Ensure() are ever
274 // As a result, we only need to set bits for each end of that range, and one
294 if ((k >> BITS) > 0) {
300 // REQUIRES "k" is in range "[0,2^BITS-1]".
310 while (k < (1 << BITS)) {
321 template <int BITS>
324 // Put 32 entries in the root and (2^BITS)/32 entries in each leaf.
328 static const int LEAF_BITS = BITS - ROOT_BITS;
350 if ((k >> BITS) > 0 || root_[i1] == NULL) {
357 ASSERT(k >> BITS == 0);
387 Ensure(0, 1 << BITS);
391 while (k < (1 << BITS)) {
410 template <int BITS>
413 // How many bits should we consume at each interior level
414 static const int INTERIOR_BITS = (BITS + 2) / 3; // Round-up
417 // How many bits should we consume at leaf level
418 static const int LEAF_BITS = BITS - 2*INTERIOR_BITS;
454 if ((k >> BITS) > 0 ||
462 ASSERT(k >> BITS == 0);
503 while (k < (Number(1) << BITS)) {