| 115 | } |
| 116 | |
| 117 | uint32_t getRandomAllocSize() { |
| 118 | // Reserve some space for the intrusive list's hook |
| 119 | constexpr uint32_t kReservedSize = 8; |
| 120 | assert(Slab::kSize >= kReservedSize); |
| 121 | return folly::Random::rand32(Slab::kSize - kReservedSize + 1) + kReservedSize; |
| 122 | } |
| 123 | |
| 124 | std::set<uint32_t> getRandomPow2AllocSizes(unsigned int n) { |
| 125 | unsigned int numBits = static_cast<unsigned int>(log2(Slab::kSize)); |
no outgoing calls
no test coverage detected