alloc/foreign: correctly rebase 'offset'

This commit is contained in:
Danny Robson 2018-03-02 12:45:27 +11:00
parent a40b1254c1
commit 950ac2229f

View File

@ -70,7 +70,9 @@ namespace util::alloc::raw::aligned {
auto offset (const void *ptr) const
{
return m_successor.offset (ptr);
return m_successor.offset (
reinterpret_cast<const std::byte*> (ptr) + m_offset
);
}
auto data (void) { return m_successor.data () - m_offset; }