#include "ourasert.h" #include "mem3dc.h" #include "mempool.h" #if USE_LEVEL_MEMORY_POOL #define MAX_NUM_MEMORY_BLOCK 40 #define MEMORY_BLOCK_SIZE (1024*1024) static char* MemoryBlocks[MAX_NUM_MEMORY_BLOCK]; static int CurrentMemoryBlock =-1; static char* MemoryPoolPtr=0; static unsigned int MemoryLeft=0; void* PoolAllocateMem(unsigned int amount) { char* retval; GLOBALASSERT(amount<=MEMORY_BLOCK_SIZE) if(amount>MemoryLeft) { CurrentMemoryBlock++; GLOBALASSERT(CurrentMemoryBlock