|
From: <sv...@va...> - 2009-02-04 06:50:31
|
Author: njn
Date: 2009-02-04 06:50:26 +0000 (Wed, 04 Feb 2009)
New Revision: 9106
Log:
Fix a minor bug, whereby a stack entry of zero would cause a "(heap
allocation functions)" line to be written.
Also invert some comparisons so the constant is first, to minimise the
chance of assignments in conditions.
Modified:
branches/DARWIN/massif/ms_main.c
Modified: branches/DARWIN/massif/ms_main.c
===================================================================
--- branches/DARWIN/massif/ms_main.c 2009-02-04 05:14:30 UTC (rev 9105)
+++ branches/DARWIN/massif/ms_main.c 2009-02-04 06:50:26 UTC (rev 9106)
@@ -561,7 +561,7 @@
if (hp + n_bytes > hp_lim) {
hp = (Addr)VG_(am_shadow_alloc)(SUPERBLOCK_SIZE);
- if (hp == 0)
+ if (0 == hp)
VG_(out_of_memory_NORETURN)( "massif:perm_malloc",
SUPERBLOCK_SIZE);
hp_lim = hp + SUPERBLOCK_SIZE - 1;
@@ -600,7 +600,7 @@
// Expand 'children' if necessary.
tl_assert(parent->n_children <= parent->max_children);
if (parent->n_children == parent->max_children) {
- if (parent->max_children == 0) {
+ if (0 == parent->max_children) {
parent->max_children = 4;
parent->children = VG_(malloc)( "ms.main.acx.1",
parent->max_children * sizeof(XPt*) );
@@ -654,7 +654,7 @@
//
// Nb: We do this once now, rather than once per child, because if we do
// that the cost of all the divisions adds up to something significant.
- if (total_szB == 0 && clo_threshold != 0) {
+ if (0 == total_szB && 0 != clo_threshold) {
sig_child_threshold_szB = 1;
} else {
sig_child_threshold_szB = (SizeT)((total_szB * clo_threshold) / 100);
@@ -1420,7 +1420,7 @@
if (n_skipped_snapshots_since_last_snapshot > 0) {
VERB(2, " (skipped %d snapshot%s)",
n_skipped_snapshots_since_last_snapshot,
- ( n_skipped_snapshots_since_last_snapshot == 1 ? "" : "s") );
+ ( 1 == n_skipped_snapshots_since_last_snapshot ? "" : "s") );
}
VERB_snapshot(2, what, next_snapshot_i);
n_skipped_snapshots_since_last_snapshot = 0;
@@ -1994,7 +1994,7 @@
switch (sxpt->tag) {
case SigSXPt:
// Print the SXPt itself.
- if (sxpt->Sig.ip == 0) {
+ if (0 == depth) {
ip_desc =
"(heap allocation functions) malloc/new/new[], --alloc-fns, etc.";
} else {
@@ -2094,7 +2094,7 @@
break;
case InsigSXPt: {
- Char* s = ( sxpt->Insig.n_xpts == 1 ? "," : "s, all" );
+ Char* s = ( 1 == sxpt->Insig.n_xpts ? "," : "s, all" );
perc = make_perc(sxpt->szB, snapshot_total_szB);
FP("%sn0: %lu in %d place%s below massif's threshold (%s)\n",
depth_str, sxpt->szB, sxpt->Insig.n_xpts, s,
|
|
From: Julian S. <js...@ac...> - 2009-02-05 09:14:40
|
I presume this will eventually show up in the trunk as a result
of Darwin merging activities. Is it also something that should
be pushed to the stable branch?
J
On Wednesday 04 February 2009, sv...@va... wrote:
> Author: njn
> Date: 2009-02-04 06:50:26 +0000 (Wed, 04 Feb 2009)
> New Revision: 9106
>
> Log:
> Fix a minor bug, whereby a stack entry of zero would cause a "(heap
> allocation functions)" line to be written.
>
> Also invert some comparisons so the constant is first, to minimise the
> chance of assignments in conditions.
>
>
>
> Modified:
> branches/DARWIN/massif/ms_main.c
>
>
> Modified: branches/DARWIN/massif/ms_main.c
> ===================================================================
> --- branches/DARWIN/massif/ms_main.c 2009-02-04 05:14:30 UTC (rev 9105)
> +++ branches/DARWIN/massif/ms_main.c 2009-02-04 06:50:26 UTC (rev 9106)
> @@ -561,7 +561,7 @@
>
> if (hp + n_bytes > hp_lim) {
> hp = (Addr)VG_(am_shadow_alloc)(SUPERBLOCK_SIZE);
> - if (hp == 0)
> + if (0 == hp)
> VG_(out_of_memory_NORETURN)( "massif:perm_malloc",
> SUPERBLOCK_SIZE);
> hp_lim = hp + SUPERBLOCK_SIZE - 1;
> @@ -600,7 +600,7 @@
> // Expand 'children' if necessary.
> tl_assert(parent->n_children <= parent->max_children);
> if (parent->n_children == parent->max_children) {
> - if (parent->max_children == 0) {
> + if (0 == parent->max_children) {
> parent->max_children = 4;
> parent->children = VG_(malloc)( "ms.main.acx.1",
> parent->max_children *
> sizeof(XPt*) ); @@ -654,7 +654,7 @@
> //
> // Nb: We do this once now, rather than once per child, because if we
> do // that the cost of all the divisions adds up to something significant.
> - if (total_szB == 0 && clo_threshold != 0) {
> + if (0 == total_szB && 0 != clo_threshold) {
> sig_child_threshold_szB = 1;
> } else {
> sig_child_threshold_szB = (SizeT)((total_szB * clo_threshold) /
> 100); @@ -1420,7 +1420,7 @@
> if (n_skipped_snapshots_since_last_snapshot > 0) {
> VERB(2, " (skipped %d snapshot%s)",
> n_skipped_snapshots_since_last_snapshot,
> - ( n_skipped_snapshots_since_last_snapshot == 1 ? "" : "s") );
> + ( 1 == n_skipped_snapshots_since_last_snapshot ? "" : "s") );
> }
> VERB_snapshot(2, what, next_snapshot_i);
> n_skipped_snapshots_since_last_snapshot = 0;
> @@ -1994,7 +1994,7 @@
> switch (sxpt->tag) {
> case SigSXPt:
> // Print the SXPt itself.
> - if (sxpt->Sig.ip == 0) {
> + if (0 == depth) {
> ip_desc =
> "(heap allocation functions) malloc/new/new[], --alloc-fns,
> etc."; } else {
> @@ -2094,7 +2094,7 @@
> break;
>
> case InsigSXPt: {
> - Char* s = ( sxpt->Insig.n_xpts == 1 ? "," : "s, all" );
> + Char* s = ( 1 == sxpt->Insig.n_xpts ? "," : "s, all" );
> perc = make_perc(sxpt->szB, snapshot_total_szB);
> FP("%sn0: %lu in %d place%s below massif's threshold (%s)\n",
> depth_str, sxpt->szB, sxpt->Insig.n_xpts, s,
>
>
> ---------------------------------------------------------------------------
>--- Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing
> skills and code to build responsive, highly engaging applications that
> combine the power of local resources and data with the reach of the web.
> Download the Adobe AIR SDK and Ajax docs to start building applications
> today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: Nicholas N. <n.n...@gm...> - 2009-02-05 21:26:36
|
On Thu, Feb 5, 2009 at 8:14 PM, Julian Seward <js...@ac...> wrote: > > I presume this will eventually show up in the trunk as a result > of Darwin merging activities. Yes, eventually... > Is it also something that should > be pushed to the stable branch? Probably. N |