45 #if defined(_MSC_VER) || defined(_WIN32_WCE) 51 MemoryManagerMemMap::MemoryManagerMemMap()
58 fullSize = reservedSize = 0;
62 MemoryManagerMemMap::~MemoryManagerMemMap()
74 fullSize = nNumInitialBytes;
76 hMapObject = CreateFileMappingW(INVALID_HANDLE_VALUE,
80 (DWORD)nNumInitialBytes,
82 if (hMapObject ==
NULL)
85 lpvMem = MapViewOfFile(hMapObject,
92 _didInit = lpvMem !=
NULL;
98 MemoryManagerMemMap::deinit()
103 if(!lpvMem || !hMapObject)
107 UnmapViewOfFile(lpvMem);
111 CloseHandle(hMapObject);
120 MemoryManagerMemMap::didInit()
127 MemoryManagerMemMap::getMemory(
size_t nNumBytes)
131 if(reservedSize+nNumBytes > fullSize)
133 assert(
false &&
"out of memory in MemoryManagerMemMap");
137 void* newBlock =
reinterpret_cast<unsigned char*
>(lpvMem) + reservedSize;
139 reservedSize += nNumBytes;
145 MemoryManagerMemMap::releaseMemory(
void* nMemoryBlock)
150 assert(
false &&
"MemoryManagerMemMap can not release memory...");
155 #endif // defined(_MSC_VER) || defined(_WIN32_WCE)