Re: GetScratchPixmapHeader / FreeScratchPixmapHeader
Alrighty, then here it is: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1032?commit_id=5781ffcf5f3c918a97fe590ddb605fe0fefdb6ca Thanks, Jeremy > On Dec 21, 2022, at 13:24, Keith Packard wrote: > > Jeremy Huddleston Sequoia writes: > >> 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... > > Seems reasonable -- it's just a CPU time optimization that probably > doesn't matter much anymore. It is often used for PutImage, but that > probably has enough overhead elsewhere to swamp malloc/free costs. > > -- > -keith
Re: GetScratchPixmapHeader / FreeScratchPixmapHeader
Jeremy Huddleston Sequoia writes: > 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... Seems reasonable -- it's just a CPU time optimization that probably doesn't matter much anymore. It is often used for PutImage, but that probably has enough overhead elsewhere to swamp malloc/free costs. -- -keith signature.asc Description: PGP signature
GetScratchPixmapHeader / FreeScratchPixmapHeader
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