1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Remove windows ifdefs

This commit is contained in:
Leonid Fedorov
2023-03-02 15:59:42 +00:00
parent 123c345b40
commit 56f2346083
328 changed files with 9 additions and 19602 deletions

View File

@ -20,13 +20,6 @@
*
*****************************************************************************/
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include <process.h>
#include <psapi.h>
#endif
#include <sys/types.h>
#include <fstream>
#include <iostream>
@ -101,21 +94,7 @@ size_t MonitorProcMem::rss() const
{
uint64_t rss;
#if defined(_MSC_VER)
HANDLE hProcess;
PROCESS_MEMORY_COUNTERS pmc;
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, fPid);
if (NULL == hProcess)
return 0;
if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc)))
rss = pmc.WorkingSetSize;
else
rss = 0;
CloseHandle(hProcess);
#elif defined(__FreeBSD__)
#if defined(__FreeBSD__)
ostringstream cmd;
cmd << "ps -a -o rss -p " << getpid() << " | tail +2";
FILE* cmdPipe;
@ -158,9 +137,6 @@ void MonitorProcMem::pause_() const
while (1)
{
#ifdef _MSC_VER
Sleep(req.tv_sec * 1000);
#else
if (nanosleep(&req, &rem) != 0)
{
@ -171,7 +147,6 @@ void MonitorProcMem::pause_() const
}
}
#endif
break;
}
}