Skip to content

RFC: Allocate less memory for every wl_callback

Vlad Zahorodnii requested to merge work/less-mallocs into master

wl_callback and wl_region are two kinds of objects that are frequently allocated.

Currently, we make two extra heap allocations per each wl_callback object. One for the wrapper object (FrameCallback) and the other one is for its Resource.

With this change, no extra allocations will be made. Also, due to relying on wl_resource linked lists, the destroy listener implementation got much simpler.

This won't result in huge memory usage or performance improvements, but still it's worth reducing the number of memory allocations where possible.

Edited by Vlad Zahorodnii

Merge request reports