Skip to content
Snippets Groups Projects
Commit 2e5bb632 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Removed unused function getCurrentRSS()

parent 7003f032
No related branches found
No related tags found
1 merge request!291M214003/develop
......@@ -84,40 +84,42 @@ size_t getPeakRSS(void)
* Returns the current resident set size (physical memory use) measured
* in bytes, or zero if the value cannot be determined on this OS.
*/
/*
static
size_t getCurrentRSS(void)
{
#if defined(_WIN32)
/* Windows -------------------------------------------------- */
// Windows --------------------------------------------------
PROCESS_MEMORY_COUNTERS info;
GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
return (size_t)info.WorkingSetSize;
#elif defined(__APPLE__) && defined(__MACH__)
/* OSX ------------------------------------------------------ */
// OSX ------------------------------------------------------
struct mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
if ( task_info( mach_task_self( ), MACH_TASK_BASIC_INFO,
(task_info_t)&info, &infoCount ) != KERN_SUCCESS )
return (size_t)0L; /* Can't access? */
return (size_t)0L; // Can't access?
return (size_t)info.resident_size;
#elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
/* Linux ---------------------------------------------------- */
// Linux ----------------------------------------------------
long rss = 0L;
FILE* fp = NULL;
if ( (fp = fopen( "/proc/self/statm", "r" )) == NULL )
return (size_t)0L; /* Can't open? */
return (size_t)0L; // Can't open?
if ( fscanf( fp, "%*s%ld", &rss ) != 1 )
{
fclose( fp );
return (size_t)0L; /* Can't read? */
return (size_t)0L; // Can't read?
}
fclose( fp );
return (size_t)rss * (size_t)sysconf( _SC_PAGESIZE);
#else
/* AIX, BSD, Solaris, and Unknown OS ------------------------ */
return (size_t)0L; /* Unsupported. */
// AIX, BSD, Solaris, and Unknown OS ------------------------
return (size_t)0L; // Unsupported.
#endif
}
*/
......@@ -324,8 +324,6 @@ process_inq_prompt(void)
return localProcess ? localProcess->inq_prompt() : cdo::progname;
}
extern "C" size_t getPeakRSS();
/* TODO move cdoClose internals into Pstream::close/ CdoStream::close */
void
cdo_stream_close(CdoStreamID pstreamPtr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment