[cairo-commit] 2 commits - perf/cairo-perf.c perf/Makefile.am

Carl Worth cworth at kemper.freedesktop.org
Wed Mar 7 09:26:03 PST 2007


 perf/Makefile.am  |   20 ++++++++++++++++++++
 perf/cairo-perf.c |    4 ++++
 2 files changed, 24 insertions(+)

New commits:
diff-tree 92d331a23407c79d83bf0b2a7d003ba3525641d4 (from 7d972086d6ea6a6bfa47b5fb47f7a21be61e10e8)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 7 13:31:54 2007 +0000

    Fix up the trivial leaks found by valgrind.

diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c
index ae83690..49f4b59 100644
--- a/perf/cairo-perf.c
+++ b/perf/cairo-perf.c
@@ -185,6 +185,7 @@ cairo_perf_run (cairo_perf_t		*perf,
     }
 
     perf->test_number++;
+    free (times);
 }
 
 static void
@@ -307,6 +308,9 @@ main (int argc, char *argv[])
 
 		cairo_destroy (perf.cr);
 		cairo_surface_destroy (surface);
+
+		if (target->cleanup)
+		    target->cleanup (target->closure);
 	    }
 	}
     }
diff-tree 7d972086d6ea6a6bfa47b5fb47f7a21be61e10e8 (from 734d32ed7a50284fcc8984af67734bb306735691)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Mar 7 12:19:44 2007 +0000

    Add valgrind/callgrind targets to Makefile.

diff --git a/perf/Makefile.am b/perf/Makefile.am
index a50ce8a..cef6431 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -60,5 +60,25 @@ $(top_builddir)/src/libcairo.la:
 perf: cairo-perf FORCE
 	./cairo-perf
 
+EXTRA_VG_FLAGS = $(CAIRO_EXTRA_VALGRIND_FLAGS)
+VG_MEMCHECK_FLAGS = \
+	--tool=memcheck \
+	--suppressions=$(top_srcdir)/test/.valgrind-suppressions \
+	--leak-check=yes --show-reachable=yes
+VG_CALLGRIND_FLAGS = \
+	--tool=callgrind
+CLEANFILES = \
+	valgrind-log
+
+perf-valgrind: cairo-perf FORCE
+	$(top_srcdir)/libtool --mode=execute \
+		valgrind $(VG_MEMCHECK_FLAGS) $(EXTRA_VG_FLAGS) \
+		./cairo-perf 2>&1 | tee valgrind-log
+perf-callgrind: cairo-perf FORCE
+	$(top_srcdir)/libtool --mode=execute \
+		valgrind $(VG_CALLGRIND_FLAGS) $(EXTRA_VG_FLAGS) \
+		./cairo-perf
+
 FORCE:
 
+.PHONY: perf perf-valgrind perf-callgrind FORCE


More information about the cairo-commit mailing list