www.pudn.com > Gimcrack-v0.0051-Source.zip > mem.h


#ifndef _MEM_H_ 
#define _MEM_H_ 
 
#include "../global.h" 
 
class GcMem 
{ 
public: 
 
	// Allocate a pool of memory 
	bool Init(uint size, bool vidMem = true); 
 
	// "Allocate" a amount of memory from the pool 
	void *Allocate(uint size); 
 
	// "Free" the memory back to the pool 
	//void Free(void *pointer); 
 
	// using video memory or not? 
	bool VideoMemory() const { return videoMem; } 
 
	// De-allocate the pool 
	void ShutDown();  
 
private: 
 
	byte		*memPool;		// The memory pool 
	uint		poolSize;		// The size of the pool 
	uint		usedSize;		// The amount of memory used 
	bool		videoMem;		// Is memory on the gfx card? 
 
}; 
 
#endif