|
From: <sv...@va...> - 2009-05-06 06:58:16
|
Author: njn
Date: 2009-05-06 07:58:09 +0100 (Wed, 06 May 2009)
New Revision: 9785
Log:
Merge r9784 (make leak check output more deterministic) from the trunk.
Modified:
branches/DARWIN/memcheck/mc_leakcheck.c
branches/DARWIN/memcheck/tests/leak-cases-full.stderr.exp
Modified: branches/DARWIN/memcheck/mc_leakcheck.c
===================================================================
--- branches/DARWIN/memcheck/mc_leakcheck.c 2009-05-06 06:52:47 UTC (rev 9784)
+++ branches/DARWIN/memcheck/mc_leakcheck.c 2009-05-06 06:58:09 UTC (rev 9785)
@@ -783,6 +783,15 @@
// If size are equal, compare by states.
if (lr_a->key.state < lr_b->key.state) return -1;
if (lr_a->key.state > lr_b->key.state) return 1;
+ // If they're still equal here, it doesn't matter that much, but we keep
+ // comparing other things so that regtests are as deterministic as
+ // possible. So: compare num_blocks.
+ if (lr_a->num_blocks < lr_b->num_blocks) return -1;
+ if (lr_a->num_blocks > lr_b->num_blocks) return 1;
+ // Finally, compare ExeContext addresses... older ones are likely to have
+ // lower addresses.
+ if (lr_a->key.allocated_at < lr_b->key.allocated_at) return -1;
+ if (lr_a->key.allocated_at > lr_b->key.allocated_at) return 1;
return 0;
}
Modified: branches/DARWIN/memcheck/tests/leak-cases-full.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/leak-cases-full.stderr.exp 2009-05-06 06:52:47 UTC (rev 9784)
+++ branches/DARWIN/memcheck/tests/leak-cases-full.stderr.exp 2009-05-06 06:58:09 UTC (rev 9785)
@@ -6,42 +6,42 @@
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:87)
+ by 0x........: f (leak-cases.c:78)
by 0x........: main (leak-cases.c:107)
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:87)
+ by 0x........: f (leak-cases.c:81)
by 0x........: main (leak-cases.c:107)
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:78)
+ by 0x........: f (leak-cases.c:84)
by 0x........: main (leak-cases.c:107)
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:81)
+ by 0x........: f (leak-cases.c:84)
by 0x........: main (leak-cases.c:107)
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:84)
+ by 0x........: f (leak-cases.c:87)
by 0x........: main (leak-cases.c:107)
16 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: mk (leak-cases.c:52)
- by 0x........: f (leak-cases.c:84)
+ by 0x........: f (leak-cases.c:87)
by 0x........: main (leak-cases.c:107)
|