2005-09-29
* Fixed build on FreeBSD for non-i386
+ * Made it so top_mem doesn't show all the forks of one process
2005-09-27
* Fixed small bug in config parsing (thanks robgrady, bug 1306032)
assert(sorttmp != NULL);
}
int total;
- unsigned int i/*, max*/;
+ unsigned int i, j;
total = calc_cpu_total(); /* calculate the total of the processor */
sizeof(struct process) * sorttmp_size);
}
qsort(sorttmp, i, sizeof(struct process *), comparemem);
- for (i = 0; i < 10; i++) {
- mem[i] = sorttmp[i];
-
+ for (i = 0, j = 0; i < sorttmp_size && j < 10; i++) {
+ if (j == 0 || sorttmp[i]->totalmem != mem[j-1]->totalmem
+ || strncmp(sorttmp[i]->name, mem[j-1]->name,128)) {
+ mem[j++] = sorttmp[i];
+ }
}
}
}
+