Function offsetOf

Synopsis

#include <Source/Falcor/Utils/AlignedAllocator.h>

size_t offsetOf(void *ptr) const

Description

Returns of the offset of the given pointer inside the allocation buffer.

Source

Lines 105-109 in Source/Falcor/Utils/AlignedAllocator.h.

size_t offsetOf(void* ptr) const
{
    assert(ptr >= mBuffer.data() && ptr < mBuffer.data() + mBuffer.size());
    return static_cast<uint8_t*>(ptr) - mBuffer.data();
}





Add Discussion as Guest

Log in to DocsForge