Skip to content

clutter/actor: Make get_transformed_paint_volume() transfer full

Transfer none was achieved using a stack GArray in the stage which would get resized to 0 at the end of every frame to "free" it. In the case of direct scanout however, painting the next frame only happens after leaving fullscreen again. Until then the array just kept growing and because GArrays don't reallocate when shrunk, this memory remained allocated even after leaving fullscreen.

There is no cache benefit from storing paint volumes this way, because nothing accesses them after their immediate use in the calling code. Also the reduced overhead from avoiding malloc calls seems negligible as according to heaptrack this only makes up about 2-3% of the temporary allocations.

Changing this to transfer full and removing the stack array simplifies the code and fixes the "leak".

Closes: #3191 (closed)

Merge request reports