/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/core/memory/alloclinear.hpp

*/

#ifndef SGX_CORE_MEMORY_ALLOCLINEAR_HPP
#define SGX_CORE_MEMORY_ALLOCLINEAR_HPP	1
 
class CSGXMemoryAllocatorLinear : public CSGXMemoryAllocator {
public:
	CSGXMemoryAllocatorLinear(void *ptr, const tMEM_SIZE size, const CSGXMemoryAlignment &alignment);
 
	void *alloc(const tMEM_SIZE size);
	tBOOL freePtr(void *ptr);
	tBOOL freeAll();
 
private:
	tBOOL		m_bLocked;
	tMEM_SIZE 	m_iCurrentIndex;
	tMEM_SIZE 	m_iLastAllocationIndex;
protected:
	CSGXMemoryAllocatorLinear() { sgxError("Please use the ctor to specify the memory block to use in this allocator."); }
};


#endif
 
