18 LUG_ASSERT(size > offset,
"The size must be greater than the offset");
21 const size_t newSize = size +
sizeof(
size_t);
22 const size_t newOffset = offset +
sizeof(
size_t);
28 if (_current <= _currentPage->end) {
31 if (std::align(alignment, newSize - newOffset,
_current, sizeLeft)) {
35 *
static_cast<size_t*
>(
static_cast<void*
>(
static_cast<char*
>(
_current) - newSize)) = size;
37 return static_cast<char*
>(
_current) - size;
71 return static_cast<size_t*
>(ptr)[-1];
lug::System::Memory::Area::Page * _currentPage
void * allocate(size_t size, size_t alignment, size_t offset)
#define LUG_ASSERT(assertion, message)
virtual Page * requestNextPage()=0
void free(void *ptr) const
lug::System::Memory::Area::Page * currentPage
lug::System::Memory::Area::IArea *const _area
size_t getSize(void *ptr) const
Linear(lug::System::Memory::Area::IArea *area)
lug::System::Memory::Area::Page * _firstPage
void rewind(const Mark &mark)