[PATCH] Initialize dev privates before using any

Julien Cristau jcristau at debian.org
Sat Jul 17 03:42:54 PDT 2010


On Thu, Jul  1, 2010 at 08:25:07 -0400, Keith Packard wrote:

> On Wed, 30 Jun 2010 19:30:51 +0300, Tiago Vignatti <tiago.vignatti at nokia.com> wrote:
> > On Wed, Jun 30, 2010 at 05:39:34PM +0200, ext Keith Packard wrote:
> > > Initializing the dev privates code after allocating the server client
> > > dev privates would cause the memory leak check to fire at server
> > > startup or reset.
> > > 
> > > Signed-off-by: Keith Packard <keithp at keithp.com>
> > > ---
> > > 
> > > This eliminates the memory leak warning which prompted Tiago's change
> > > to print those only in debug builds.
> > 
> > Honestly I don't know about the code around and didn't understand the
> > "eliminates the memory leak" that you mentioned.
> 
> It's not an actual leak; the devPrivates code tracks the number of
> private structures initialized and at dixResetPrivates time, there
> aren't supposed to be any active. If there are, that indicates a
> probable memory leak.
> 
Xephyr outputs the following at reset for me, on 1.9 rc5:

1 XSELINUXs still allocated at reset
SCREEN: 0 objects of 152 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 32 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 184 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 56 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
TOTAL: 1 objects, 16 bytes, 0 allocs
1 PIXMAPs still allocated at reset
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
TOTAL: 1 objects, 16 bytes, 0 allocs
1 DAMAGEs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs

Cheers,
Julien


More information about the xorg-devel mailing list