gnome-system-monitor r2498 - trunk/src
- From: bdejean svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-system-monitor r2498 - trunk/src
- Date: Tue, 9 Sep 2008 18:49:14 +0000 (UTC)
Author: bdejean
Date: Tue Sep 9 18:49:14 2008
New Revision: 2498
URL: http://svn.gnome.org/viewvc/gnome-system-monitor?rev=2498&view=rev
Log:
Nano-optimization.
Modified:
trunk/src/proctable.cpp
Modified: trunk/src/proctable.cpp
==============================================================================
--- trunk/src/proctable.cpp (original)
+++ trunk/src/proctable.cpp Tue Sep 9 18:49:14 2008
@@ -486,21 +486,23 @@
{
glibtop_proc_map buf;
glibtop_map_entry *maps;
- unsigned i;
-
- info->memwritable = 0;
maps = glibtop_get_proc_map(&buf, info->pid);
- for (i = 0; i < buf.number; ++i) {
+ gulong memwritable = 0;
+ const unsigned number = buf.number;
+
+ for (unsigned i = 0; i < number; ++i) {
#ifdef __linux__
- info->memwritable += maps[i].private_dirty;
+ memwritable += maps[i].private_dirty;
#else
if (maps[i].perm & GLIBTOP_MAP_PERM_WRITE)
- info->memwritable += maps[i].size;
+ memwritable += maps[i].size;
#endif
}
+ info->memwritable = memwritable;
+
g_free(maps);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]