From 39cb26654a9564306e6eb825e2da8c61fd36c78e Mon Sep 17 00:00:00 2001 From: Soren Sandmann Date: Sun, 26 Aug 2007 05:41:59 +0000 Subject: [PATCH] Compute the size by simply summing the size of the siblings. They are 2007-08-26 Soren Sandmann * profile.c (profile_get_size): Compute the size by simply summing the size of the siblings. They are toplevel by definition, and this works if the siblings for some reason has the same address. svn path=/trunk/; revision=371 --- ChangeLog | 6 ++++++ collector.c | 2 +- profile.c | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33822134..e3a9fb8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-26 Soren Sandmann + + * profile.c (profile_get_size): Compute the size by simply summing + the size of the siblings. They are toplevel by definition, and + this works if the siblings for some reason has the same address. + 2007-08-26 Soren Sandmann * treeviewutils.c (process_iter): Reformat and fix various minor diff --git a/collector.c b/collector.c index 5a0ec57e..062d5395 100644 --- a/collector.c +++ b/collector.c @@ -393,7 +393,7 @@ collector_create_profile (Collector *collector) info.unique_cmdlines = g_hash_table_new (g_str_hash, g_str_equal); stack_stash_foreach (collector->stash, resolve_symbols, &info); - + g_hash_table_destroy (info.unique_symbols); g_hash_table_destroy (info.unique_cmdlines); diff --git a/profile.c b/profile.c index f87701b0..d93a5f3f 100644 --- a/profile.c +++ b/profile.c @@ -595,7 +595,7 @@ compute_total (StackNode *node) if (n->toplevel) total += n->total; } - + return total; } @@ -608,10 +608,10 @@ build_object_list (StackNode *node, gpointer data) obj = g_new (ProfileObject, 1); obj->name = node->address; - - obj->total = compute_total (node); + obj->total = compute_total (node); obj->self = 0; + for (n = node; n != NULL; n = n->next) obj->self += n->size; @@ -634,9 +634,9 @@ profile_get_size (Profile *profile) { StackNode *n; gint size = 0; - + for (n = stack_stash_get_root (profile->stash); n != NULL; n = n->siblings) - size += compute_total (n); + size += n->total; return size; }