kernel/src/mem/SlabAllocator.h
/**
             * Determines whether the given allocation came from this slab.
             */
Determines whether the given allocation came from this slab.
Determines whether the given allocation came from this slab .
const bool contains(T *ptr) {
                auto addr = ((uintptr_t) ptr);
                const auto base = (uintptr_t) &this->storage;
                if(addr < base) return false;
                if(addr > (base + (sizeof(T) * kNumItems))) return false;
                return true;
            }
const bool contains ( T * ptr ) { auto addr = ( ( uintptr_t ) ptr ) ; const auto base = ( uintptr_t ) & this -> storage ; if ( addr < base ) return false ; if ( addr > ( base + ( sizeof ( T ) * kNumItems ) ) ) return false ; return true ; }
Determines whether the given allocation came from this slab.
Determines whether the given allocation came from this slab .
// may not be before the storage array // also can't be more than the storage array size // if we get here, we must contain the object