Skip to content

gmem: Add g_free_sized() and g_aligned_free_sized()

Philip Withnall requested to merge pwithnall/glib:free-sized into main

These wrap free_sized() and free_aligned_sized(), which are present in C23[1]. This means that user code can start to use them without checking for C23 support everywhere first.

It also means we can use them internally in GSlice to get a bit of performance for the code which still uses it.

See https://en.cppreference.com/w/c/memory/free_aligned_sized and https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2699.htm.

[1]: Specifically, section 7.24.3.4 of the latest C23 draft at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Merge request reports