From 2e06291d4bb96fc50b29b8ae0ea8770b418bebf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Thu, 21 Sep 2023 21:41:15 +0200 Subject: [PATCH] darwin-module: Optimize exports enumeration slightly By preallocating the prefix string ahead of trie iteration. --- gum/gumdarwinmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gum/gumdarwinmodule.c b/gum/gumdarwinmodule.c index e5a4ff345..9d876116c 100644 --- a/gum/gumdarwinmodule.c +++ b/gum/gumdarwinmodule.c @@ -2860,7 +2860,7 @@ gum_exports_trie_foreach (const guint8 * exports, ctx.func = func; ctx.user_data = user_data; - ctx.prefix = g_string_new (""); + ctx.prefix = g_string_sized_new (1024); ctx.exports = exports; ctx.exports_end = exports_end;