WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
MemoryUtils.cpp
Go to the documentation of this file.
1
#include "
MemoryUtils.h
"
2
#include <windows.h>
3
#include <Psapi.h>
4
#pragma comment(lib, "psapi.lib")
// Added to support GetProcessMemoryInfo()
5
#include "logger\Logger.h"
6
7
void
core::displayMemInfo
(std::string message,
bool
displaySQLiteSize)
8
{
9
std::string log = message +
" Memory: "
+ std::to_string(
getMemoryUsed
()) +
" Mo"
;
10
LOG_INFO
<< log.c_str();
11
}
12
13
int
core::getMemoryUsed
()
14
{
15
PROCESS_MEMORY_COUNTERS memCounter;
16
int
result = -1;
17
18
if
(GetProcessMemoryInfo(GetCurrentProcess(), &memCounter,
sizeof
(memCounter)))
19
result = memCounter.WorkingSetSize / (1024 * 1024);
20
21
return
result;
22
}
LOG_INFO
#define LOG_INFO
Definition
Logger.h:10
MemoryUtils.h
core::displayMemInfo
void __cdecl displayMemInfo(std::string message, bool displaySQLiteSize=false)
Log current process memory usage to the Logger.
Definition
MemoryUtils.cpp:7
core::getMemoryUsed
int __cdecl getMemoryUsed()
Return the current process memory usage in kilobytes.
Definition
MemoryUtils.cpp:13
Source
Engine
Core
Memory
MemoryUtils.cpp
Generated by
1.9.8