PPC - Determine Available Memory

From YYpBD's MediaWiki

Jump to: navigation, search

    MEMORYSTATUS   memInfo;
    STORE_INFORMATION   si;
    TCHAR   szBuf[MAX_PATH];

    // Program memory.
    memInfo.dwLength = sizeof(memInfo);
    GlobalMemoryStatus(&memInfo);

    wsprintf(szBuf, __TEXT("Total RAM: %d bytes\n Free: %d \nUsed: %d"),
        memInfo.dwTotalPhys, memInfo.dwAvailPhys, memInfo.dwTotalPhys —
        memInfo.dwAvailPhys);
    MessageBox(hwnd, szBuf, __TEXT("Program Memory"), MB_OK);

    // Storage memory.
    GetStoreInformation(&si);
  
    // dwStoreSize isn't exact due to compression.
    wsprintf(szBuf, __TEXT("Free: %d"), si.dwFreeSize);
    MessageBox(hwnd, szBuf, __TEXT("Storage Memory"), MB_OK);

맞춤검색