GetScratchPixmapHeader / FreeScratchPixmapHeader

Jeremy Huddleston Sequoia jeremyhu at freedesktop.org
Wed Dec 21 20:49:25 UTC 2022


In triaging some issues related to pixmaps in XQuartz / rootlesss these past few weeks, I found it useful to just disable recycling the scratch pixmap header.  Specifically, in my debug build, GetScratchPixmapHeader() just does CreatePixmap + ModifyPixmapHeader and FreeScratchPixmapHeader() just does DestroyPixmap.

The reason for this is that recycling this pixmap header makes it harder for memory analysis tools to track the lifecycle of the allocation.  ASan, malloc history, et al see its lifecycle from malloc() to free(), but its real lifecycle is between GetScratchPixmapHeader() and FreeScratchPixmapHeader().

Is there any real benefit to maintaining this released pixmap for future re-use on modern hardware?  It seems like it's a bunch of code complexity without much benefit.  I'm happy to nuke it completely unless there are objections...

--Jeremy



More information about the xorg-devel mailing list