Skip to content

Allow using msort_r CHERI-enabled architectures

Alexander Richardson requested to merge arichardson/glib:msort-cheri into main

If we are sorting something that is a multiple of sizeof(void*), we have to ensure that we swap one pointer at a time since swapping using sub-pointer-size stores invalidate the pointers (pointers have a hidden validity tags that is invalidated when performing non-monotonic operations such as storing only part of the pointers).

While touching this code also use G_ALIGNOF() instead of a macro that is generated at configure time.

Helps: #2842

Merge request reports