跳转至

base/system/memory/private/win_impl/swap_memory.cpp

Swap Space Query Implementation (Windows) More...

Namespaces

Name
cf
cf::win_impl

Defines

Name
WIN32_LEAN_AND_MEAN

Detailed Description

Swap Space Query Implementation (Windows)

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-23

Copyright: Copyright © 2026

Macros Documentation

define WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN 

Source code

#include "swap_memory.h"
#ifndef WIN32_LEAN_AND_MEAN
#    define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>

namespace cf {
namespace win_impl {

void querySwapMemory(SwapMemory& swap) {
    MEMORYSTATUSEX status;
    status.dwLength = sizeof(status);
    GlobalMemoryStatusEx(&status);

    swap.total_bytes = status.ullTotalPageFile;
    swap.free_bytes = status.ullAvailPageFile;
}

} // namespace win_impl
} // namespace cf

Updated on 2026-03-09 at 10:14:01 +0000