[PULL] dtors-v2: simple clients and toytoolkit

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 19 01:56:27 PST 2011


Hi Kristian,

I've been playing a lot with Valgrind the last week, and here are some
results. This patch set adds destructors to toytoolkit so we explicitly
release memory we allocate. To actually Valgrind that, I added an exit
key binding to resizor and used that, since resizor is possibly the
simplest toytoolkit application.

The difference in the Valgrind reports between "resizor: add exit key
and cleanups" commit and dtors-v2 is:

 vvv LEAK SUMMARY:
-vvv    definitely lost: 1,680 bytes in 12 blocks
-vvv    indirectly lost: 203,688 bytes in 129 blocks
+vvv    definitely lost: 192 bytes in 1 blocks
+vvv    indirectly lost: 0 bytes in 0 blocks
 vvv      possibly lost: 0 bytes in 0 blocks
-vvv    still reachable: 7,091 bytes in 17 blocks
-vvv         suppressed: 1,223,269 bytes in 30,857 blocks
+vvv    still reachable: 2,267 bytes in 8 blocks
+vvv         suppressed: 1,187,441 bytes in 30,798 blocks
 vvv 
-vvv ERROR SUMMARY: 12 errors from 12 contexts (suppressed: 22369 from 189)
+vvv ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 44292 from 190)

Lots of custom suppressions were used to catch leaks and errors in
Mesa, libxkbcommon, cairo, glib, gdk, and pixman.

In addition, I first ran the simple clients with Valgrind and fixed
everything I could. simple-shm is totally Valgrind-clean now, and the
only Valgrind reports on simple-egl are from Mesa.

The following changes since commit 7bb92f0c0309d7487c5275b4171ed28bfacd96ac:

  Activate toplevel fullscreen and menu surfaces (2011-12-15 11:31:51 -0500)

are available in the git repository at:
  git://git.collabora.co.uk/git/user/pq/wayland-demos.git dtors-v2

Pekka Paalanen (13):
      simple clients: add signal handler for clean exit
      simple-shm: implement destructors
      simple-egl: implement destructors
      simple clients: flush before destroying wl_display
      window: add display_exit()
      window: add display_destroy()
      resizor: add exit key and cleanups
      window: remove unused struct members
      window: destroy window surfaces and title
      window: destroy outputs on display_destroy()
      window: destroy misc objects on display_destroy()
      window: destroy all inputs on display_destroy()
      window: destroy surfaces on display_destroy()

 clients/resizor.c    |   44 +++++++++--
 clients/simple-egl.c |   63 ++++++++++++++--
 clients/simple-shm.c |   62 ++++++++++++++--
 clients/window.c     |  198 ++++++++++++++++++++++++++++++++++++++++++++-----
 clients/window.h     |    6 ++
 5 files changed, 331 insertions(+), 42 deletions(-)


Thanks,
pq


More information about the wayland-devel mailing list