| 582 | // for benchmarking purposes. |
| 583 | const unsigned int kMarkerBits = 6; |
| 584 | CompressedPtr4B SlabAllocator::compressAlt(const void* ptr) const { |
| 585 | if (ptr == nullptr) { |
| 586 | return CompressedPtr4B{}; |
| 587 | } |
| 588 | |
| 589 | ptrdiff_t delta = reinterpret_cast<const uint8_t*>(ptr) - |
| 590 | reinterpret_cast<const uint8_t*>(slabMemoryStart_); |
| 591 | return CompressedPtr4B{ |
| 592 | static_cast<CompressedPtr4B::PtrType>(delta >> kMarkerBits)}; |
| 593 | } |
| 594 | |
| 595 | void* SlabAllocator::unCompressAlt(const CompressedPtr4B cPtr) const { |
| 596 | if (cPtr.isNull()) { |
no outgoing calls
no test coverage detected