[gtk/optimize-precompile: 5/11] builder: Use a reasonable default string size in precompile




commit 4af0af37f26f9f9b4f9d8da74993fe49271170fe
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue Sep 21 14:26:24 2021 -0700

    builder: Use a reasonable default string size in precompile

 gtk/gtkbuilderprecompile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c
index b43952a559..72a8d9f8c7 100644
--- a/gtk/gtkbuilderprecompile.c
+++ b/gtk/gtkbuilderprecompile.c
@@ -393,7 +393,7 @@ _gtk_buildable_parser_precompile (const char  *text,
       offset += s->len + 1;
     }
 
-  marshaled = g_string_new ("");
+  marshaled = g_string_sized_new (4 + offset + 32);
   /* Magic marker */
   g_string_append_len (marshaled, "GBU\0", 4);
   marshal_uint32 (marshaled, offset);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]