[glib/glib-2-70: 1/2] GString: Bump minimum size
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-70: 1/2] GString: Bump minimum size
- Date: Tue, 19 Oct 2021 06:21:56 +0000 (UTC)
commit 5f64478a6807d9200f8b042a877d0fed129d9b7c
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 18 20:16:57 2021 -0400
GString: Bump minimum size
GString starts out at a size of 2, which is just
not useful. Bump the minimum size to 64 to cut
down on the number of tiny reallocations we do.
glib/gstring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gstring.c b/glib/gstring.c
index a400d4f24..17dc2c33d 100644
--- a/glib/gstring.c
+++ b/glib/gstring.c
@@ -123,7 +123,7 @@ g_string_sized_new (gsize dfl_size)
string->len = 0;
string->str = NULL;
- g_string_maybe_expand (string, MAX (dfl_size, 2));
+ g_string_maybe_expand (string, MAX (dfl_size, 64));
string->str[0] = 0;
return string;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]