Commit 8ad4f10b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdoFinish: change units of memmax.

parent 4df69479
......@@ -1328,18 +1328,15 @@ void cdoFinish(void)
if (processID == 0)
{
int mu[] = { 'b', 'k', 'm', 'g', 't' };
int muindex = 0;
size_t memmax = getPeakRSS();
while (memmax > 9999)
if (memmax)
{
memmax /= 1024;
muindex++;
int muindex = 0;
while (memmax > 9999) { memmax /= 1024; muindex++; }
const char *mu[] = { "B", "KB", "MB", "GB", "TB" };
snprintf(memstring, sizeof(memstring), " %zu%s", memmax, mu[muindex]);
}
if (memmax)
snprintf(memstring, sizeof(memstring), " %zu%c", memmax, mu[muindex]);
processEndTime(&p_usertime, &p_systime);
p_cputime = p_usertime + p_systime;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment