Enable function GetProcessMemoryInfo() to get reliable memory usage data
for MINGW and MSVC console, WinGui and MSVC shared ngspice. MINGW shared ngspice does not link to psapi.dll, so cannot apply GetProcessMemoryInfo(), but sticks to unreliable function GlobalMemoryStatusEx().
This commit is contained in:
parent
035156be66
commit
cf6722af17
|
|
@ -334,6 +334,15 @@ if WINGUI
|
|||
LIBS += -lpsapi
|
||||
endif
|
||||
|
||||
if WINCONSOLE
|
||||
LIBS += -lpsapi
|
||||
endif
|
||||
|
||||
## FIXME: Should be allwed, but fails within MSYS2
|
||||
#if SHWIN
|
||||
#LIBS += -lpsapi
|
||||
#endif
|
||||
|
||||
CLEANFILES = ngspice.idx spinit tclspinit pkgIndex.tcl
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -479,7 +479,8 @@ fprintmem(FILE *stream, unsigned long long memory) {
|
|||
static int get_procm(struct proc_mem *memall) {
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if (_WIN32_WINNT >= 0x0500) && defined(HAS_WINGUI)
|
||||
/* FIXME: shared module should be allowed, but currently does not link to psapi within MINGW/MSYS2 */
|
||||
#if (_WIN32_WINNT >= 0x0500) && (!defined(SHARED_MODULE) || _MSC_VER)
|
||||
/* Use Windows API function to obtain size of memory - more accurate */
|
||||
HANDLE hProcess;
|
||||
PROCESS_MEMORY_COUNTERS pmc;
|
||||
|
|
|
|||
Loading…
Reference in New Issue