启动时分配和释放大量内存是否“清理内存”?
《游戏编码完成》第四版,第5章(游戏初始化和关闭),“ 检查内存”部分包含以下有趣的代码示例: bool CheckMemory(const DWORDLONG physicalRAMNeeded, const DWORDLONG virtualRAMNeeded) { MEMORYSTATUSEX status; GlobalMemoryStatusEx(&status); if (status.ullTotalPhys < physicalRAMNeeded) { // you don’t have enough physical memory. Tell the player to go get a // real computer and give this one to his mother. GCC_ERROR("CheckMemory Failure: Not enough physical memory."); return false; …