Index: glib/gscanner.c
===================================================================
--- glib/gscanner.c	(revision 5377)
+++ glib/gscanner.c	(working copy)
@@ -61,6 +61,7 @@
 )
 #define	READ_BUFFER_SIZE	(4000)
 
+#define	STRING_NEW_SIZE	(16)
 
 /* --- typedefs --- */
 typedef	struct	_GScannerKey	GScannerKey;
@@ -1276,7 +1277,7 @@
 	  g_scanner_get_char (scanner, line_p, position_p);
 	  token = G_TOKEN_COMMENT_MULTI;
 	  in_comment_multi = TRUE;
-	  gstring = g_string_new (NULL);
+	  gstring = g_string_sized_new (STRING_NEW_SIZE);
 	  while ((ch = g_scanner_get_char (scanner, line_p, position_p)) != 0)
 	    {
 	      if (ch == '*' && g_scanner_peek_next_char (scanner) == '/')
@@ -1296,7 +1297,7 @@
 	    goto default_case;
 	  token = G_TOKEN_STRING;
 	  in_string_sq = TRUE;
-	  gstring = g_string_new (NULL);
+	  gstring = g_string_sized_new (STRING_NEW_SIZE);
 	  while ((ch = g_scanner_get_char (scanner, line_p, position_p)) != 0)
 	    {
 	      if (ch == '\'')
@@ -1315,7 +1316,7 @@
 	    goto default_case;
 	  token = G_TOKEN_STRING;
 	  in_string_dq = TRUE;
-	  gstring = g_string_new (NULL);
+	  gstring = g_string_sized_new (STRING_NEW_SIZE);
 	  while ((ch = g_scanner_get_char (scanner, line_p, position_p)) != 0)
 	    {
 	      if (ch == '"')
@@ -1477,7 +1478,8 @@
 	  if (token == G_TOKEN_NONE)
 	    token = G_TOKEN_INT;
 	  
-	  gstring = g_string_new (dotted_float ? "0." : "");
+	  gstring = g_string_sized_new (STRING_NEW_SIZE);
+	  if (dotted_float) gstring = g_string_append_c (gstring, "0.");
 	  gstring = g_string_append_c (gstring, ch);
 	  
 	  do /* while (in_number) */
@@ -1621,7 +1623,7 @@
 	    {
 	      token = G_TOKEN_COMMENT_SINGLE;
 	      in_comment_single = TRUE;
-	      gstring = g_string_new (NULL);
+	      gstring = g_string_sized_new (STRING_NEW_SIZE);
 	      ch = g_scanner_get_char (scanner, line_p, position_p);
 	      while (ch != 0)
 		{
@@ -1650,7 +1652,7 @@
 			  g_scanner_peek_next_char (scanner)))
 		{
 		  token = G_TOKEN_IDENTIFIER;
-		  gstring = g_string_new (NULL);
+		  gstring = g_string_sized_new (STRING_NEW_SIZE);
 		  gstring = g_string_append_c (gstring, ch);
 		  do
 		    {
