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,6 +20,8 @@
#include "config.h"
#include "timsort/gtktimsortprivate.h"
#include "sysprof-callgraph-private.h"
#include "sysprof-callgraph-frame-private.h"
#include "sysprof-callgraph-symbol-private.h"
@ -990,7 +992,11 @@ sysprof_callgraph_list_traceables_for_node_async (SysprofCallgraph *self,
}
/* Sort the bitsets by size to shrink potential interscetions */
g_ptr_array_sort (bitsets, sort_by_size_asc);
gtk_tim_sort (bitsets->pdata,
bitsets->len,
sizeof (gpointer),
(GCompareDataFunc)sort_by_size_asc,
NULL);
bitset = egg_bitset_copy (g_ptr_array_index (bitsets, 0));
for (guint i = 1; i < bitsets->len; i++)
{