libsysprof: port GPtrArray sort to gtk_tim_sort()

This commit is contained in:
Christian Hergert
2024-08-16 12:50:21 -07:00
parent b06c08c64e
commit 54295a1466
3 changed files with 22 additions and 3 deletions

View File

@ -20,7 +20,10 @@
#include "config.h"
#include "timsort/gtktimsortprivate.h"
#include <gio/gio.h>
#include <eggbitset.h>
#include "sysprof-address-layout-private.h"
@ -204,7 +207,11 @@ sysprof_address_layout_lookup (SysprofAddressLayout *self,
self->mmaps_dirty = FALSE;
g_ptr_array_sort (self->mmaps, compare_mmaps);
gtk_tim_sort (self->mmaps->pdata,
self->mmaps->len,
sizeof (gpointer),
(GCompareDataFunc)compare_mmaps,
NULL);
dups = find_duplicates (self->mmaps);
if (egg_bitset_iter_init_last (&iter, dups, &i))