alloc/foreign: dellocate should take a void pointer

This commit is contained in:
Danny Robson 2019-10-02 12:39:32 +10:00
parent ccdc0b6807
commit 442dd12f8f

View File

@ -76,17 +76,17 @@ namespace cruft::alloc::aligned {
decltype(auto)
deallocate (u08 *ptr, std::size_t bytes, std::size_t alignment)
deallocate (void *ptr, std::size_t bytes, std::size_t alignment)
{
CHECK_MOD (m_alignment, alignment);
return m_successor.deallocate (ptr - m_offset, bytes, alignment);
return m_successor.deallocate (reinterpret_cast<u08*> (ptr) - m_offset, bytes, alignment);
}
decltype(auto)
deallocate (u08 *ptr, std::size_t bytes)
deallocate (void *ptr, std::size_t bytes)
{
return m_successor.deallocate (ptr - m_offset, bytes, m_alignment);
return m_successor.deallocate (reinterpret_cast<u08*> (ptr) - m_offset, bytes, m_alignment);
}