ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/utils/residentMem.c
(Generate patch)

Comparing trunk/OOPSE-4/src/utils/residentMem.c (file contents):
Revision 2041 by tim, Wed Feb 16 21:13:48 2005 UTC vs.
Revision 2759 by tim, Wed May 17 21:51:42 2006 UTC

# Line 6 | Line 6
6   #include <unistd.h>
7   #endif
8  
9 #define to_string( s ) # s
10 #define STR_DEFINE(t, s) t = to_string(s)
11
9   /*
10   * returns an estimate of the resident memory size in kB
11   */
12 < double residentMem () {
12 > RealType residentMem () {
13  
14    FILE* procresults;
15    char buf[150];
# Line 23 | Line 20 | double residentMem () {
20  
21    STR_DEFINE(psPath, PSCOMMAND );
22  
23 <  // null terminated string is one longer....
23 >  
24    strncpy(pscommand, psPath, strlen(psPath)+1);
25  
26   #ifdef PSTYPE_IS_BSD
# Line 52 | Line 49 | double residentMem () {
49    pclose(procresults);
50  
51   #ifdef __sgi
52 <  // Damn IRIX machines uses pages for RSS and pagesize is variable
53 <  // depending on version of the OS.
52 >  
53 >  
54    totRSS *= getpagesize() / 1024;
55   #endif
56  
57 <  //return in byte
57 >  
58    totRSS *= 1024;
59    return(totRSS);
60  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines