/** * Allocate memory buffer. */ void* CChunkedMemoryAllocator::Alloc(size_t size, const IZ_CHAR* file, IZ_UINT line) { size = _ComputeAlignValue(size, m_nChunkSize); void* ret = AllocInternal(size, file, line); return ret; }
void* FrameAllocator::AllocAligned(size_t size, size_t alignment) { byte_t offset = CalcAlignedOffset(m_TopAddr, alignment); size_t newSize = size + offset; void* addr = AllocInternal(newSize); addr = (void*)((size_t)addr + offset); // Stores the offset information 1 byte before the returned memory address byte_t* byteAddr = (byte_t*)addr; --byteAddr; *byteAddr = offset; return addr; }
void* FrameAllocator::Alloc(size_t size) { return AllocInternal(size); }