diff --git a/alloc/chunked.cpp b/alloc/chunked.cpp index ee6a1edb..b87d5092 100644 --- a/alloc/chunked.cpp +++ b/alloc/chunked.cpp @@ -64,7 +64,13 @@ chunked::do_allocate (std::size_t size, std::size_t alignment) } // No chunk was found. We need to allocate a new chunk of at least enough size. - unimplemented (); + std::size_t allocation_size = cruft::max (size + alignment, m_chunk); + std::unique_ptr ptr (new std::byte[allocation_size]); + m_data.push_back (arena { ptr.get () }); + m_data.back ().node->size = allocation_size; + m_data.back ().node->next = m_data.back ().node; + ptr.release (); + return do_allocate (size, alignment); }