alloc/raw/linear: don't align by default

This commit is contained in:
Danny Robson 2018-04-20 15:04:00 +10:00
parent cbce5803b5
commit 09b9c1dc8b

View File

@ -34,7 +34,12 @@ linear::linear (util::view<std::byte*> _data):
void*
linear::allocate (size_t bytes)
{
return allocate (bytes, alignof (std::max_align_t));
if (m_cursor + bytes > m_end)
throw std::bad_alloc ();
auto ptr = m_cursor;
m_cursor += bytes;
return ptr;
}