2006-01-29  Behdad Esfahbod  <behdad@gnome.org>

	* modules/arabic/arabic-fc.c, modules/basic/basic-fc.c
	modules/hebrew/hebrew-fc.c, modules/indic/indic-fc.c
	modules/khmer/khmer-fc.c, modules/syriac/syriac-fc.c
	modules/thai/thai-ot.c, modules/thai/thai-shaper.c
	modules/tibetan/tibetan-fc.c: If locking font face failed,
	do not assert, just return zero glyphs with an implicit
	warning.

	* pango/fonts.c, pango/glyphstring.c pango/modules.c
	pango/pango-color.c, pango/pango-context.c
	pango/pango-coverage.c, pango/pango-fontmap.c
	pango/pango-glyph-item.c, pango/pango-item.c
	pango/pango-layout.c, pango/pango-markup.c
	pango/pango-ot-buffer.c, pango/pango-script.c
	pango/pango-tabs.c, pango/pango-utils.c
	pango/pangoatsui-fontmap.c, pango/pangocairo-fcfont.c
	pango/pangocairo-fcfontmap.c, pango/pangocairo-fontmap.c
	pango/pangocairo-win32font.c, pango/pangofc-font.c
	pango/pangofc-fontmap.c, pango/pangoft2-fontmap.c
	pango/pangoft2-render.c, pango/pangoft2.c
	pango/pangowin32-fontcache.c, pango/pangoxft-font.c
	pango/pangoxft-render.c, pango/break.c pango/ellipsize.c:
	Use g_slice for allocating all types.  Also, change some
	g_error's to g_critical's...

Index: modules/arabic/arabic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/arabic/arabic-fc.c,v
retrieving revision 1.23
diff -u -p -r1.23 arabic-fc.c
--- modules/arabic/arabic-fc.c	14 Jan 2006 07:00:05 -0000	1.23
+++ modules/arabic/arabic-fc.c	29 Jan 2006 22:57:41 -0000
@@ -256,16 +256,16 @@ arabic_engine_shape (PangoEngineShape *e
 		     PangoAnalysis    *analysis,
 		     PangoGlyphString *glyphs)
 {
-  glong n_chars;
-  gunichar *wcs;
-  int i;
-  const char *p;
-  gulong *properties = NULL;
+  PangoFcFont *fc_font;
   FT_Face face;
   PangoOTRuleset *ruleset;
   PangoOTBuffer *buffer;
-  PangoFcFont *fc_font;
+  gulong *properties = NULL;
+  glong n_chars;
+  gunichar *wcs;
+  const char *p;
   int cluster = 0;
+  int i;
 
   g_return_if_fail (font != NULL);
   g_return_if_fail (text != NULL);
@@ -273,9 +273,8 @@ arabic_engine_shape (PangoEngineShape *e
   g_return_if_fail (analysis != NULL);
 
   fc_font = PANGO_FC_FONT (font);
-
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face);
+  g_return_if_fail (face != NULL);
 
   ruleset = get_ruleset (face);
   if (!ruleset)
Index: modules/basic/basic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-fc.c,v
retrieving revision 1.25
diff -u -p -r1.25 basic-fc.c
--- modules/basic/basic-fc.c	23 Jan 2006 12:43:35 -0000	1.25
+++ modules/basic/basic-fc.c	29 Jan 2006 22:57:41 -0000
@@ -327,27 +327,24 @@ basic_engine_shape (PangoEngineShape *en
 		    PangoAnalysis    *analysis,
 		    PangoGlyphString *glyphs)
 {
-  PangoFcFont *fc_font = PANGO_FC_FONT (font);
+  PangoFcFont *fc_font;
   FT_Face face;
   PangoOTRuleset *ruleset;
   PangoOTBuffer *buffer;
   gint unknown_property = 0;
-  int n_chars;
-  int i;
+  glong n_chars;
   const char *p;
   int cluster = 0;
+  int i;
 
   g_return_if_fail (font != NULL);
   g_return_if_fail (text != NULL);
   g_return_if_fail (length >= 0);
   g_return_if_fail (analysis != NULL);
 
-  n_chars = g_utf8_strlen (text, length);
-  pango_glyph_string_set_size (glyphs, n_chars);
-
+  fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face != NULL);
-
+  g_return_if_fail (face != NULL);
 
   ruleset = get_ruleset (face);
   if (!ruleset)
@@ -359,6 +356,9 @@ basic_engine_shape (PangoEngineShape *en
 
   buffer = pango_ot_buffer_new (fc_font);
   pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0);
+
+  n_chars = g_utf8_strlen (text, length);
+  pango_glyph_string_set_size (glyphs, n_chars);
 
   p = text;
   for (i=0; i < n_chars; i++)
Index: modules/hebrew/hebrew-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/hebrew/hebrew-fc.c,v
retrieving revision 1.14
diff -u -p -r1.14 hebrew-fc.c
--- modules/hebrew/hebrew-fc.c	14 Jan 2006 07:00:06 -0000	1.14
+++ modules/hebrew/hebrew-fc.c	29 Jan 2006 22:57:41 -0000
@@ -295,14 +295,15 @@ hebrew_engine_shape (PangoEngineShape *e
 		     PangoAnalysis    *analysis,
 		     PangoGlyphString *glyphs)
 {
-  const gchar *p;
-  gint i;
-  glong n_chars;
-  gint unknown_property = 0;
+  PangoFcFont *fc_font;
   FT_Face face;
   PangoOTRuleset *ruleset;
   PangoOTBuffer *buffer;
-  PangoFcFont *fc_font;
+  gint unknown_property = 0;
+  glong n_chars;
+  const char *p;
+  int cluster = 0;
+  int i;
 
   g_return_if_fail (font != NULL);
   g_return_if_fail (text != NULL);
@@ -310,9 +311,8 @@ hebrew_engine_shape (PangoEngineShape *e
   g_return_if_fail (analysis != NULL);
 
   fc_font = PANGO_FC_FONT (font);
-
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face);
+  g_return_if_fail (face != NULL);
 
   ruleset = get_ruleset (face);
   if (!ruleset)
@@ -327,7 +327,6 @@ hebrew_engine_shape (PangoEngineShape *e
   n_chars = g_utf8_strlen (text, length);
       
   p = text;
-
   for (i=0; i < n_chars; i++)
     {
       gunichar wc;
@@ -335,7 +334,6 @@ hebrew_engine_shape (PangoEngineShape *e
       PangoGlyph index;
       char buf[6];
       const char *input;
-      int cluster = 0;
 
       wc = g_utf8_get_char (p);
       input = p;
Index: modules/indic/indic-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/indic-fc.c,v
retrieving revision 1.20
diff -u -p -r1.20 indic-fc.c
--- modules/indic/indic-fc.c	23 Jan 2006 12:43:36 -0000	1.20
+++ modules/indic/indic-fc.c	29 Jan 2006 22:57:41 -0000
@@ -325,17 +325,17 @@ indic_engine_shape (PangoEngineShape *en
 		    PangoAnalysis    *analysis,
 		    PangoGlyphString *glyphs)
 {
+  PangoFcFont *fc_font;
+  FT_Face face;
+  PangoOTRuleset *gsub_ruleset, *gpos_ruleset;
+  PangoOTBuffer *buffer;
   glong i, n_chars, n_glyphs;
   gulong *tags = NULL;
   gunichar *wc_in = NULL, *wc_out = NULL;
   glong *utf8_offsets = NULL;
   glong *indices = NULL;
-  FT_Face face;
-  PangoOTRuleset *gsub_ruleset = NULL, *gpos_ruleset = NULL;
-  PangoOTBuffer *buffer;
   IndicEngineFc *indic_shape_engine = NULL;
   const PangoIndicInfo *indic_info = NULL;
-  PangoFcFont *fc_font;
   MPreFixups *mprefixups;
 
   g_return_if_fail (font != NULL);
@@ -345,7 +345,7 @@ indic_engine_shape (PangoEngineShape *en
 
   fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face != NULL);
+  g_return_if_fail (face != NULL);
 
   indic_shape_engine = (IndicEngineFc *) engine;
 
Index: modules/khmer/khmer-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/khmer/khmer-fc.c,v
retrieving revision 1.7
diff -u -p -r1.7 khmer-fc.c
--- modules/khmer/khmer-fc.c	14 Jan 2006 07:00:08 -0000	1.7
+++ modules/khmer/khmer-fc.c	29 Jan 2006 22:57:41 -0000
@@ -522,25 +522,32 @@ khmer_engine_shape (PangoEngineShape *en
                     PangoAnalysis    *analysis,
                     PangoGlyphString *glyphs)
 {
-  PangoFcFont *fc_font = PANGO_FC_FONT (font);
+  PangoFcFont *fc_font;
   FT_Face face;
-  PangoOTBuffer *buffer;
   PangoOTRuleset *ruleset;
-  glong n_chars, i;
+  PangoOTBuffer *buffer;
+  glong n_chars;
   gunichar *wcs;
   const char *p;
+  int i;
   glong syllable;
   KhmerCharClass charClass;
   glong cursor = 0;
 
-  buffer = pango_ot_buffer_new (fc_font);
+  g_return_if_fail (font != NULL);
+  g_return_if_fail (text != NULL);
+  g_return_if_fail (length >= 0);
+  g_return_if_fail (analysis != NULL);
 
+  fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face);
+  g_return_if_fail (face != NULL);
+
+  buffer = pango_ot_buffer_new (fc_font);
 
   wcs = g_utf8_to_ucs4_fast (text, length, &n_chars);
-  p = text;
 
+  p = text;
   /* This loop only exits when we reach the end of a run, which may contain
    * several syllables.
    */
Index: modules/syriac/syriac-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/syriac/syriac-fc.c,v
retrieving revision 1.7
diff -u -p -r1.7 syriac-fc.c
--- modules/syriac/syriac-fc.c	14 Jan 2006 07:00:09 -0000	1.7
+++ modules/syriac/syriac-fc.c	29 Jan 2006 22:57:41 -0000
@@ -248,16 +248,16 @@ syriac_engine_shape (PangoEngineShape *e
 		     PangoAnalysis    *analysis,
 		     PangoGlyphString *glyphs)
 {
-  glong n_chars;
-  gunichar *wcs;
-  int i;
-  const char *p;
-  gulong *properties = NULL;
+  PangoFcFont *fc_font;
   FT_Face face;
   PangoOTRuleset *ruleset;
   PangoOTBuffer *buffer;
-  PangoFcFont *fc_font;
+  gulong *properties = NULL;
+  glong n_chars;
+  gunichar *wcs;
+  const char *p;
   int cluster = 0;
+  int i;
 
   g_return_if_fail (font != NULL);
   g_return_if_fail (text != NULL);
@@ -265,9 +265,8 @@ syriac_engine_shape (PangoEngineShape *e
   g_return_if_fail (analysis != NULL);
 
   fc_font = PANGO_FC_FONT (font);
-
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face);
+  g_return_if_fail (face != NULL);
 
   ruleset = get_ruleset (face);
   if (!ruleset)
Index: modules/thai/thai-ot.c
===================================================================
RCS file: /cvs/gnome/pango/modules/thai/thai-ot.c,v
retrieving revision 1.7
diff -u -p -r1.7 thai-ot.c
--- modules/thai/thai-ot.c	14 Jan 2006 07:00:09 -0000	1.7
+++ modules/thai/thai-ot.c	29 Jan 2006 22:57:42 -0000
@@ -76,7 +76,7 @@ thai_ot_get_ruleset (PangoFont *font)
 
   fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face != NULL);
+  g_return_val_if_fail (face != NULL, NULL);
 
   info = pango_ot_info_get (face);
   if (info != NULL)
@@ -148,7 +148,7 @@ lao_ot_get_ruleset (PangoFont *font)
 
   fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face != NULL);
+  g_return_val_if_fail (face != NULL, NULL);
 
   info = pango_ot_info_get (face);
   if (info != NULL)
@@ -215,9 +215,6 @@ thai_ot_shape (PangoFont        *font,
 {
   PangoOTRuleset *th_ruleset;
   PangoOTRuleset *lo_ruleset;
-
-  g_return_if_fail (font != NULL);
-  g_return_if_fail (glyphs != NULL);
 
   th_ruleset = thai_ot_get_ruleset (font);
   lo_ruleset = lao_ot_get_ruleset (font);
Index: modules/thai/thai-shaper.c
===================================================================
RCS file: /cvs/gnome/pango/modules/thai/thai-shaper.c,v
retrieving revision 1.19
diff -u -p -r1.19 thai-shaper.c
--- modules/thai/thai-shaper.c	14 Jan 2006 07:00:09 -0000	1.19
+++ modules/thai/thai-shaper.c	29 Jan 2006 22:57:42 -0000
@@ -531,11 +531,16 @@ thai_engine_shape (PangoEngineShape *eng
 		   PangoAnalysis    *analysis,
 		   PangoGlyphString *glyphs)
 {
-  ThaiFontInfo *font_info;
+  gint n_chars;
   const char *p;
+  ThaiFontInfo *font_info;
   const char *log_cluster;
   gunichar cluster[MAX_CLUSTER_CHRS];
-  gint num_chrs;
+
+  g_return_if_fail (font != NULL);
+  g_return_if_fail (text != NULL);
+  g_return_if_fail (length >= 0);
+  g_return_if_fail (analysis != NULL);
 
   pango_glyph_string_set_size (glyphs, 0);
 
@@ -545,8 +550,8 @@ thai_engine_shape (PangoEngineShape *eng
   while (p < text + length)
     {
 	log_cluster = p;
-	p = get_next_cluster (p, text + length - p, cluster, &num_chrs);
-	add_cluster (font_info, glyphs, log_cluster - text, cluster, num_chrs);
+	p = get_next_cluster (p, text + length - p, cluster, &n_chars);
+	add_cluster (font_info, glyphs, log_cluster - text, cluster, n_chars);
     }
   thai_ot_shape (font, glyphs);
 }
Index: modules/tibetan/tibetan-fc.c
===================================================================
RCS file: /cvs/gnome/pango/modules/tibetan/tibetan-fc.c,v
retrieving revision 1.3
diff -u -p -r1.3 tibetan-fc.c
--- modules/tibetan/tibetan-fc.c	14 Jan 2006 07:00:10 -0000	1.3
+++ modules/tibetan/tibetan-fc.c	29 Jan 2006 22:57:42 -0000
@@ -487,25 +487,32 @@ tibetan_engine_shape (PangoEngineShape *
                     PangoAnalysis    *analysis,
                     PangoGlyphString *glyphs)
 {
-  PangoFcFont *fc_font = PANGO_FC_FONT (font);
+  PangoFcFont *fc_font;
   FT_Face face;
-  PangoOTBuffer *buffer;
   PangoOTRuleset *ruleset;
-  glong n_chars, i;
+  PangoOTBuffer *buffer;
+  glong n_chars;
   gunichar *wcs;
   const char *p;
+  int i;
   glong syllable;
   TibetanCharClass charClass;
   glong cursor = 0;
 
-  buffer = pango_ot_buffer_new (fc_font);
+  g_return_if_fail (font != NULL);
+  g_return_if_fail (text != NULL);
+  g_return_if_fail (length >= 0);
+  g_return_if_fail (analysis != NULL);
 
+  fc_font = PANGO_FC_FONT (font);
   face = pango_fc_font_lock_face (fc_font);
-  g_assert (face);
+  g_return_if_fail (face != NULL);
+
+  buffer = pango_ot_buffer_new (fc_font);
 
   wcs = g_utf8_to_ucs4_fast (text, length, &n_chars);
-  p = text;
 
+  p = text;
   /* This loop only exits when we reach the end of a run, which may contain
    * several syllables.
    */
Index: pango/break.c
===================================================================
RCS file: /cvs/gnome/pango/pango/break.c,v
retrieving revision 1.40
diff -u -p -r1.40 break.c
--- pango/break.c	14 Jan 2006 07:00:10 -0000	1.40
+++ pango/break.c	29 Jan 2006 22:57:42 -0000
@@ -561,10 +561,7 @@ pango_default_break (const gchar   *text
   if (length == 0 || *text == '\0')
     next_wc = PARAGRAPH_SEPARATOR;
   else
-    {
-      next_wc = g_utf8_get_char (next);
-      g_assert (next_wc != 0);
-    }
+    next_wc = g_utf8_get_char (next);
 
   next_break_type = g_unichar_break_type (next_wc);
   next_break_type = BREAK_TYPE_SAFE (next_break_type);
@@ -605,10 +602,7 @@ pango_default_break (const gchar   *text
 	      almost_done = TRUE;
             }
           else
-            {
-              next_wc = g_utf8_get_char (next);
-              g_assert (next_wc != 0);
-            }
+	    next_wc = g_utf8_get_char (next);
 	  
 	  next_break_type = g_unichar_break_type (next_wc);
           next_break_type = BREAK_TYPE_SAFE (next_break_type);
Index: pango/ellipsize.c
===================================================================
RCS file: /cvs/gnome/pango/pango/ellipsize.c,v
retrieving revision 1.6
diff -u -p -r1.6 ellipsize.c
--- pango/ellipsize.c	14 Jan 2006 07:00:10 -0000	1.6
+++ pango/ellipsize.c	29 Jan 2006 22:57:42 -0000
@@ -307,7 +307,7 @@ shape_ellipsis (EllipsizeState *state)
    */
   if (!state->ellipsis_run)
     {
-      state->ellipsis_run = g_new (PangoGlyphItem, 1);
+      state->ellipsis_run = g_slice_new (PangoGlyphItem);
       state->ellipsis_run->glyphs = pango_glyph_string_new ();
       state->ellipsis_run->item = NULL;
     }
Index: pango/fonts.c
===================================================================
RCS file: /cvs/gnome/pango/pango/fonts.c,v
retrieving revision 1.77
diff -u -p -r1.77 fonts.c
--- pango/fonts.c	21 Jan 2006 19:51:25 -0000	1.77
+++ pango/fonts.c	29 Jan 2006 22:57:43 -0000
@@ -85,7 +85,7 @@ static const PangoFontDescription pfd_de
 PangoFontDescription *
 pango_font_description_new (void)
 {
-  PangoFontDescription *desc = g_new (PangoFontDescription, 1);
+  PangoFontDescription *desc = g_slice_new (PangoFontDescription);
 
   *desc = pfd_defaults;
 
@@ -596,7 +596,7 @@ pango_font_description_better_match (con
 PangoFontDescription *
 pango_font_description_copy  (const PangoFontDescription  *desc)
 {
-  PangoFontDescription *result = g_new (PangoFontDescription, 1);
+  PangoFontDescription *result = g_slice_new (PangoFontDescription);
 
   *result = *desc;
 
@@ -624,7 +624,7 @@ pango_font_description_copy  (const Pang
 PangoFontDescription *
 pango_font_description_copy_static (const PangoFontDescription *desc)
 {
-  PangoFontDescription *result = g_new (PangoFontDescription, 1);
+  PangoFontDescription *result = g_slice_new (PangoFontDescription);
 
   *result = *desc;
   if (result->family_name)
@@ -723,7 +723,7 @@ pango_font_description_free  (PangoFontD
       if (desc->family_name && !desc->static_family)
 	g_free (desc->family_name);
 
-      g_free (desc);
+      g_slice_free (PangoFontDescription, desc);
     }
 }
 
@@ -883,7 +883,7 @@ pango_font_description_from_string (cons
 
   g_return_val_if_fail (str != NULL, NULL);
 
-  desc = g_new (PangoFontDescription, 1);
+  desc = g_slice_new (PangoFontDescription);
 
   desc->mask = PANGO_FONT_MASK_STYLE |
                PANGO_FONT_MASK_WEIGHT |
@@ -1236,7 +1236,7 @@ pango_font_metrics_get_type (void)
 PangoFontMetrics *
 pango_font_metrics_new (void)
 {
-  PangoFontMetrics *metrics = g_new0 (PangoFontMetrics, 1);
+  PangoFontMetrics *metrics = g_slice_new0 (PangoFontMetrics);
   metrics->ref_count = 1;
 
   return metrics;
@@ -1277,7 +1277,7 @@ pango_font_metrics_unref (PangoFontMetri
   metrics->ref_count--;
   
   if (metrics->ref_count == 0)
-    g_free (metrics);
+    g_slice_free (PangoFontMetrics, metrics);
 }
 
 /**
Index: pango/glyphstring.c
===================================================================
RCS file: /cvs/gnome/pango/pango/glyphstring.c,v
retrieving revision 1.20
diff -u -p -r1.20 glyphstring.c
--- pango/glyphstring.c	14 Jan 2006 07:00:10 -0000	1.20
+++ pango/glyphstring.c	29 Jan 2006 22:57:43 -0000
@@ -35,7 +35,7 @@
 PangoGlyphString *
 pango_glyph_string_new (void)
 {
-  PangoGlyphString *string = g_new (PangoGlyphString, 1);
+  PangoGlyphString *string = g_slice_new (PangoGlyphString);
 
   string->num_glyphs = 0;
   string->space = 0;
@@ -65,7 +65,10 @@ pango_glyph_string_set_size (PangoGlyphS
         string->space *= 2;
       
       if (string->space < 0)
-        g_error ("%s: glyph string length overflows maximum integer size", G_STRLOC);
+        {
+	  g_critical ("glyph string length overflows maximum integer size, truncated");
+	  new_len = string->space = G_MAXINT - 8;
+	}
     }
   
   string->glyphs = g_realloc (string->glyphs, string->space * sizeof (PangoGlyphInfo));
@@ -97,7 +100,7 @@ pango_glyph_string_get_type (void)
 PangoGlyphString *
 pango_glyph_string_copy (PangoGlyphString *string)
 {
-  PangoGlyphString *new_string = g_new (PangoGlyphString, 1);
+  PangoGlyphString *new_string = g_slice_new (PangoGlyphString);
 
   *new_string = *string;
 
@@ -120,7 +123,7 @@ pango_glyph_string_free (PangoGlyphStrin
 {
   g_free (string->glyphs);
   g_free (string->log_clusters);
-  g_free (string);
+  g_slice_free (PangoGlyphString, string);
 }
 
 /**
Index: pango/modules.c
===================================================================
RCS file: /cvs/gnome/pango/pango/modules.c,v
retrieving revision 1.53
diff -u -p -r1.53 modules.c
--- pango/modules.c	14 Jan 2006 07:00:10 -0000	1.53
+++ pango/modules.c	29 Jan 2006 22:57:43 -0000
@@ -138,7 +138,7 @@ pango_find_map (PangoLanguage *language,
 
   if (!tmp_list)
     {
-      map_info = g_new (PangoMapInfo, 1);
+      map_info = g_slice_new (PangoMapInfo);
       map_info->language = language;
       map_info->engine_type_id = engine_type_id;
       map_info->render_type_id = render_type_id;
@@ -286,7 +286,7 @@ handle_included_module (PangoIncludedMod
 
   for (i = 0; i < n_engines; i++)
     {
-      PangoEnginePair *pair = g_new (PangoEnginePair, 1);
+      PangoEnginePair *pair = g_slice_new (PangoEnginePair);
 
       pair->info = engine_info[i];
       pair->module = module;
@@ -354,6 +354,12 @@ script_from_string (const char *str)
   return value->value;
 }
 
+static void
+script_info_free (PangoEngineScriptInfo *script_info, gpointer data)
+{
+  g_slice_free (PangoEngineScriptInfo, script_info);
+}
+
 static gboolean /* Returns true if succeeded, false if failed */
 process_module_file (FILE *module_file)
 {
@@ -363,7 +369,7 @@ process_module_file (FILE *module_file)
 
   while (pango_read_line (module_file, line_buf))
     {
-      PangoEnginePair *pair = g_new (PangoEnginePair, 1);
+      PangoEnginePair *pair = g_slice_new (PangoEnginePair);
       PangoEngineScriptInfo *script_info;
       PangoScript script;
       GList *scripts = NULL;
@@ -377,7 +383,7 @@ process_module_file (FILE *module_file)
 
       if (!pango_skip_space (&p))
 	{
-	  g_free (pair);
+	  g_slice_free (PangoEnginePair, pair);
 	  continue;
 	}
 
@@ -419,7 +425,7 @@ process_module_file (FILE *module_file)
 		  goto error;
 		}
 	      
-	      script_info = g_new (PangoEngineScriptInfo, 1);
+	      script_info = g_slice_new (PangoEngineScriptInfo);
 	      script_info->script = script;
 	      script_info->langs = g_strdup (q + 1);
 	      
@@ -454,13 +460,13 @@ process_module_file (FILE *module_file)
       dlloaded_engines = g_slist_prepend (dlloaded_engines, pair);
 
     error:
-      g_list_foreach (scripts, (GFunc)g_free, NULL);
+      g_list_foreach (scripts, (GFunc)script_info_free, NULL);
       g_list_free (scripts);
 
       if (have_error)
 	{
 	  g_printerr ("Error reading Pango modules file\n");
-	  g_free(pair);
+	  g_slice_free(PangoEnginePair, pair);
 	  break;
 	}
     }
@@ -581,8 +587,6 @@ map_add_engine_list (PangoMapInfo *info,
 static void
 build_map (PangoMapInfo *info)
 {
-  PangoMap *map;
-
   const char *engine_type = g_quark_to_string (info->engine_type_id);
   const char *render_type = g_quark_to_string (info->render_type_id);
   
@@ -608,8 +612,8 @@ build_map (PangoMapInfo *info)
 	}
     }
   
-  info->map = map = g_new (PangoMap, 1);
-  map->entries = g_array_new (FALSE, TRUE, sizeof (PangoMapEntry));
+  info->map = g_slice_new (PangoMap);
+  info->map->entries = g_array_new (FALSE, TRUE, sizeof (PangoMapEntry));
 			      
   map_add_engine_list (info, dlloaded_engines, engine_type, render_type);  
   map_add_engine_list (info, registered_engines, engine_type, render_type);  
Index: pango/pango-color.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-color.c,v
retrieving revision 1.11
diff -u -p -r1.11 pango-color.c
--- pango/pango-color.c	14 Jan 2006 07:00:10 -0000	1.11
+++ pango/pango-color.c	29 Jan 2006 22:57:43 -0000
@@ -58,7 +58,7 @@ pango_color_copy (const PangoColor *src)
 
   g_return_val_if_fail (src != NULL, NULL);
   
-  ret = g_new (PangoColor, 1);
+  ret = g_slice_new (PangoColor);
 
   *ret = *src;
 
@@ -76,7 +76,7 @@ pango_color_free (PangoColor *color)
 {
   g_return_if_fail (color != NULL);
 
-  g_free (color);
+  g_slice_free (PangoColor, color);
 }
 
 /* Color parsing
Index: pango/pango-context.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-context.c,v
retrieving revision 1.85
diff -u -p -r1.85 pango-context.c
--- pango/pango-context.c	21 Jan 2006 19:51:25 -0000	1.85
+++ pango/pango-context.c	29 Jan 2006 22:57:43 -0000
@@ -443,7 +443,7 @@ static void
 shaper_font_cache_destroy (ShaperFontCache *cache)
 {
   g_hash_table_destroy (cache->hash);
-  g_free (cache);
+  g_slice_free (ShaperFontCache, cache);
 }
 
 static void
@@ -466,7 +466,7 @@ get_shaper_font_cache (PangoFontset *fon
   cache = g_object_get_qdata (G_OBJECT (fontset), cache_quark);
   if (!cache)
     {
-      cache = g_new (ShaperFontCache, 1);
+      cache = g_slice_new (ShaperFontCache);
       cache->hash = g_hash_table_new_full (g_direct_hash, NULL,
 					   NULL, (GDestroyNotify)shaper_font_element_destroy);
 
Index: pango/pango-coverage.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-coverage.c,v
retrieving revision 1.20
diff -u -p -r1.20 pango-coverage.c
--- pango/pango-coverage.c	29 Jan 2006 20:58:40 -0000	1.20
+++ pango/pango-coverage.c	29 Jan 2006 22:57:43 -0000
@@ -58,7 +58,7 @@ struct _PangoCoverage
 PangoCoverage *
 pango_coverage_new (void)
 {
-  PangoCoverage *coverage = g_new (PangoCoverage, 1);
+  PangoCoverage *coverage = g_slice_new (PangoCoverage);
 
   coverage->n_blocks = N_BLOCKS_INCREMENT;
   coverage->blocks = g_new0 (PangoBlockInfo, coverage->n_blocks);
@@ -85,7 +85,7 @@ pango_coverage_copy (PangoCoverage *cove
 
   g_return_val_if_fail (coverage != NULL, NULL);
 
-  result = g_new (PangoCoverage, 1);
+  result = g_slice_new (PangoCoverage);
   result->n_blocks = coverage->n_blocks;
   result->blocks = g_new (PangoBlockInfo, coverage->n_blocks);
   result->ref_count = 1;
@@ -150,7 +150,7 @@ pango_coverage_unref (PangoCoverage *cov
 	}
       
       g_free (coverage->blocks);
-      g_free (coverage);
+      g_slice_free (PangoCoverage, coverage);
     }
 }
 
@@ -447,7 +447,7 @@ PangoCoverage *
 pango_coverage_from_bytes (guchar *bytes,
 			   int     n_bytes)
 {
-  PangoCoverage *coverage = g_new0 (PangoCoverage, 1);
+  PangoCoverage *coverage = g_slice_new0 (PangoCoverage);
   guchar *ptr = bytes;
   int i;
 
Index: pango/pango-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-fontmap.c,v
retrieving revision 1.19
diff -u -p -r1.19 pango-fontmap.c
--- pango/pango-fontmap.c	27 Jan 2006 19:14:29 -0000	1.19
+++ pango/pango-fontmap.c	29 Jan 2006 22:57:43 -0000
@@ -221,7 +221,7 @@ pango_font_map_real_load_fontset (PangoF
   /* Everything failed, we are screwed, there is no way to continue
    */
   if (pango_fontset_simple_size (fonts) == 0)
-      g_error ("All font fallbacks failed!!!!");
+      g_critical ("All font fallbacks failed!!!!");
 
   return PANGO_FONTSET (fonts);
 }
Index: pango/pango-glyph-item.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-glyph-item.c,v
retrieving revision 1.12
diff -u -p -r1.12 pango-glyph-item.c
--- pango/pango-glyph-item.c	14 Jan 2006 07:00:10 -0000	1.12
+++ pango/pango-glyph-item.c	29 Jan 2006 22:57:43 -0000
@@ -96,7 +96,7 @@ pango_glyph_item_split (PangoGlyphItem *
 
   num_remaining = orig->glyphs->num_glyphs - num_glyphs;
 
-  new = g_new (PangoGlyphItem, 1);
+  new = g_slice_new (PangoGlyphItem);
   split_offset = g_utf8_pointer_to_offset (text + orig->item->offset,
 					   text + orig->item->offset + split_index);
   new->item = pango_item_split (orig->item, split_index, split_offset);
@@ -144,7 +144,7 @@ pango_glyph_item_free  (PangoGlyphItem *
   if (glyph_item->glyphs)
     pango_glyph_string_free (glyph_item->glyphs);
 
-  g_free (glyph_item);
+  g_slice_free (PangoGlyphItem, glyph_item);
 }
 
 /**
Index: pango/pango-item.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-item.c,v
retrieving revision 1.10
diff -u -p -r1.10 pango-item.c
--- pango/pango-item.c	14 Jan 2006 07:00:10 -0000	1.10
+++ pango/pango-item.c	29 Jan 2006 22:57:43 -0000
@@ -34,7 +34,7 @@
 PangoItem *
 pango_item_new (void)
 {
-  PangoItem *result = g_new0 (PangoItem, 1);
+  PangoItem *result = g_slice_new0 (PangoItem);
 
   return result;
 }
@@ -51,7 +51,7 @@ PangoItem *
 pango_item_copy (PangoItem *item)
 {
   GSList *extra_attrs, *tmp_list;
-  PangoItem *result = g_new (PangoItem, 1);
+  PangoItem *result = g_slice_new (PangoItem);
 
   result->offset = item->offset;
   result->length = item->length;
@@ -92,7 +92,7 @@ pango_item_free (PangoItem *item)
   if (item->analysis.font)
     g_object_unref (item->analysis.font);
 
-  g_free (item);
+  g_slice_free (PangoItem, item);
 }
 
 GType
Index: pango/pango-layout.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-layout.c,v
retrieving revision 1.157
diff -u -p -r1.157 pango-layout.c
--- pango/pango-layout.c	29 Jan 2006 00:55:24 -0000	1.157
+++ pango/pango-layout.c	29 Jan 2006 22:57:43 -0000
@@ -929,7 +929,7 @@ pango_layout_set_markup_with_accel (Pang
                            accel_char,
                            &error))
     {
-      g_warning ("%s: %s", G_STRLOC, error->message);
+      g_warning ("pango_layout_set_markup_with_accel: %s", error->message);
       g_error_free (error);
       return;
     }
@@ -2096,7 +2096,7 @@ pango_layout_get_extents_internal (Pango
         
         if (line_extents)
           {
-            Extents *ext = g_new (Extents, 1);
+            Extents *ext = g_slice_new (Extents);
             ext->baseline = baseline;
             ext->ink_rect = line_ink_layout;
             ext->logical_rect = line_logical_layout;
@@ -2398,13 +2398,20 @@ static void shape_tab (PangoLayoutLine  
 		       PangoGlyphString *glyphs);
 
 static void
-free_run (PangoLayoutRun *run, gboolean free_item)
+free_run (PangoLayoutRun *run, gpointer data)
 {
+  gboolean free_item = data != NULL;
   if (free_item)
     pango_item_free (run->item);
 
   pango_glyph_string_free (run->glyphs);
-  g_free (run);
+  g_slice_free (PangoLayoutRun, run);
+}
+
+static void
+extents_free (Extents *ext, gpointer data)
+{
+  g_slice_free (Extents, ext);
 }
 
 static PangoItem *
@@ -2422,7 +2429,7 @@ uninsert_run (PangoLayoutLine *line)
   line->length -= item->length;
   
   g_slist_free_1 (tmp_node);
-  free_run (run, FALSE);
+  free_run (run, (gpointer)FALSE);
 
   return item;
 }
@@ -2737,7 +2744,7 @@ insert_run (PangoLayoutLine *line,
 	    PangoItem       *run_item,
 	    gboolean         last_run)
 {
-  PangoLayoutRun *run = g_new (PangoLayoutRun, 1);
+  PangoLayoutRun *run = g_slice_new (PangoLayoutRun);
 
   run->item = run_item;
 
@@ -3373,14 +3380,9 @@ pango_layout_line_unref (PangoLayoutLine
   if (private->ref_count == 0)
     {
       GSList *tmp_list = line->runs;
-      while (tmp_list)
-	{
-	  free_run (tmp_list->data, TRUE);
-	  tmp_list = tmp_list->next;
-	}
-
+      g_slist_foreach (line->runs, (GFunc)free_run, GINT_TO_POINTER (1));
       g_slist_free (line->runs);
-      g_free (line);
+      g_slice_free (PangoLayoutLinePrivate, private);
     }
 }
 
@@ -4028,7 +4030,7 @@ pango_layout_line_get_extents (PangoLayo
 static PangoLayoutLine *
 pango_layout_line_new (PangoLayout *layout)
 {
-  PangoLayoutLinePrivate *private = g_new (PangoLayoutLinePrivate, 1);
+  PangoLayoutLinePrivate *private = g_slice_new (PangoLayoutLinePrivate);
 
   private->ref_count = 1;
   private->line.layout = layout;
@@ -4525,7 +4527,7 @@ pango_layout_iter_copy (PangoLayoutIter 
   PangoLayoutIter *new;
   GSList *l;
 
-  new = g_new (PangoLayoutIter, 1);
+  new = g_slice_new (PangoLayoutIter);
   
   new->layout = g_object_ref (iter->layout);
   new->line_list_link = iter->line_list_link;
@@ -4596,7 +4598,7 @@ pango_layout_get_iter (PangoLayout *layo
   
   g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
   
-  iter = g_new (PangoLayoutIter, 1);
+  iter = g_slice_new (PangoLayoutIter);
 
   iter->layout = layout;
   g_object_ref (iter->layout);
@@ -4642,11 +4644,11 @@ pango_layout_iter_free (PangoLayoutIter 
 {
   g_return_if_fail (iter != NULL);
 
-  g_slist_foreach (iter->line_extents, (GFunc) g_free, NULL);
+  g_slist_foreach (iter->line_extents, (GFunc)extents_free, NULL);
   g_slist_free (iter->line_extents);
   pango_layout_line_unref (iter->line);
   g_object_unref (iter->layout);
-  g_free (iter);
+  g_slice_free (PangoLayoutIter, iter);
 }
 
 /**
Index: pango/pango-markup.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-markup.c,v
retrieving revision 1.26
diff -u -p -r1.26 pango-markup.c
--- pango/pango-markup.c	14 Jan 2006 07:00:10 -0000	1.26
+++ pango/pango-markup.c	29 Jan 2006 22:57:44 -0000
@@ -191,7 +191,7 @@ open_tag_free (OpenTag *ot)
 {
   g_slist_foreach (ot->attrs, (GFunc) pango_attribute_destroy, NULL);
   g_slist_free (ot->attrs);
-  g_free (ot);
+  g_slice_free (OpenTag, ot);
 }
 
 static void
@@ -226,7 +226,7 @@ markup_data_open_tag (MarkupData   *md)
   if (md->tag_stack)
     parent = md->tag_stack->data;
   
-  ot = g_new (OpenTag, 1);
+  ot = g_slice_new (OpenTag);
   ot->attrs = NULL;
   ot->start_index = md->index;
   ot->scale_level_delta = 0;
@@ -315,7 +315,7 @@ markup_data_close_tag (MarkupData *md)
     }
   
   g_slist_free (ot->attrs);
-  g_free (ot);  
+  g_slice_free (OpenTag, ot);  
 }
 
 static void
@@ -591,7 +591,7 @@ pango_parse_markup (const char          
   
   g_return_val_if_fail (markup_text != NULL, FALSE);
   
-  md = g_new (MarkupData, 1);
+  md = g_slice_new (MarkupData);
 
   /* Don't bother creating these if they weren't requested;
    * might be useful e.g. if you just want to validate
@@ -686,7 +686,7 @@ pango_parse_markup (const char          
   
   g_assert (md->tag_stack == NULL);
   
-  g_free (md);
+  g_slice_free (MarkupData, md);
 
   return TRUE;
 
@@ -700,7 +700,7 @@ pango_parse_markup (const char          
   if (md->attr_list)
     pango_attr_list_unref (md->attr_list);
 
-  g_free (md);
+  g_slice_free (MarkupData, md);
 
   if (context)
     g_markup_parse_context_free (context);
Index: pango/pango-ot-buffer.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-ot-buffer.c,v
retrieving revision 1.2
diff -u -p -r1.2 pango-ot-buffer.c
--- pango/pango-ot-buffer.c	28 Jan 2006 21:55:25 -0000	1.2
+++ pango/pango-ot-buffer.c	29 Jan 2006 22:57:44 -0000
@@ -49,7 +49,7 @@ pango_ot_buffer_new (PangoFcFont *font)
   FT_Face face = pango_fc_font_lock_face (font);
 
   if (otl_buffer_new (face->memory, &buffer->buffer) != FT_Err_Ok)
-    g_error ("Allocation of OTLBuffer failed");
+    g_critical ("Allocation of OTLBuffer failed"); /* this doesn't happen */
 
   buffer->font = g_object_ref (font);
   buffer->applied_gpos = FALSE;
@@ -112,7 +112,6 @@ pango_ot_buffer_add_glyph (PangoOTBuffer
 {
   otl_buffer_add_glyph (buffer->buffer,
 			glyph, properties, cluster);
-
 }
 
 /**
Index: pango/pango-script.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-script.c,v
retrieving revision 1.18
diff -u -p -r1.18 pango-script.c
--- pango/pango-script.c	14 Jan 2006 07:00:11 -0000	1.18
+++ pango/pango-script.c	29 Jan 2006 22:57:44 -0000
@@ -155,7 +155,7 @@ PangoScriptIter *
 pango_script_iter_new (const char *text,
 		       int         length)
 {
-  PangoScriptIter *iter = g_new (PangoScriptIter, 1);
+  PangoScriptIter *iter = g_slice_new (PangoScriptIter);
 
   iter->text_start = text;
   if (length >= 0)
@@ -185,7 +185,7 @@ pango_script_iter_new (const char *text,
 void
 pango_script_iter_free (PangoScriptIter *iter)
 {
-  g_free (iter);
+  g_slice_free (PangoScriptIter, iter);
 }
 
 /**
Index: pango/pango-tabs.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-tabs.c,v
retrieving revision 1.13
diff -u -p -r1.13 pango-tabs.c
--- pango/pango-tabs.c	29 Jan 2006 00:55:24 -0000	1.13
+++ pango/pango-tabs.c	29 Jan 2006 22:57:44 -0000
@@ -79,7 +79,7 @@ pango_tab_array_new (gint initial_size,
    * If we allowed tab array resizing we'd need to drop this
    * optimization.
    */
-  array = g_new (PangoTabArray, 1);
+  array = g_slice_new (PangoTabArray);
   array->size = initial_size;
   array->allocated = initial_size;
 
@@ -202,7 +202,7 @@ pango_tab_array_free   (PangoTabArray *t
 
   g_free (tab_array->tabs);
   
-  g_free (tab_array);
+  g_slice_free (PangoTabArray, tab_array);
 }
 
 /**
Index: pango/pango-utils.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-utils.c,v
retrieving revision 1.70
diff -u -p -r1.70 pango-utils.c
--- pango/pango-utils.c	28 Jan 2006 20:29:18 -0000	1.70
+++ pango/pango-utils.c	29 Jan 2006 22:57:44 -0000
@@ -1583,7 +1583,7 @@ alias_free (struct PangoAlias *alias)
 
   g_free (alias->families);
   
-  g_free (alias);
+  g_slice_free (struct PangoAlias, alias);
 }
 
 static void
@@ -1665,7 +1665,7 @@ read_alias_file (const char *filename)
       
       if (!alias)
 	{
-	  alias = g_new0 (struct PangoAlias, 1);
+	  alias = g_slice_new0 (struct PangoAlias);
 	  alias->alias = alias_key.alias;
 	  
 	  g_hash_table_insert (pango_aliases_ht,
Index: pango/pangoatsui-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoatsui-fontmap.c,v
retrieving revision 1.6
diff -u -p -r1.6 pangoatsui-fontmap.c
--- pango/pangoatsui-fontmap.c	26 Jan 2006 20:33:49 -0000	1.6
+++ pango/pangoatsui-fontmap.c	29 Jan 2006 22:57:44 -0000
@@ -440,13 +440,13 @@ font_hash_key_free (FontHashKey *key)
     PANGO_ATSUI_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap,
 								     key->context_key);
   
-  g_free (key);
+  g_slice_free (FontHashKey, key);
 }
 
 static FontHashKey *
 font_hash_key_copy (FontHashKey *old)
 {
-  FontHashKey *key = g_new (FontHashKey, 1);
+  FontHashKey *key = g_slice_new (FontHashKey);
   
   key->fontmap = old->fontmap;
   key->matrix = old->matrix;
Index: pango/pangocairo-fcfont.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-fcfont.c,v
retrieving revision 1.25
diff -u -p -r1.25 pangocairo-fcfont.c
--- pango/pangocairo-fcfont.c	27 Jan 2006 19:14:29 -0000	1.25
+++ pango/pangocairo-fcfont.c	29 Jan 2006 22:57:44 -0000
@@ -267,10 +267,9 @@ pango_cairo_fc_font_get_metrics (PangoFo
       if (!fcfont->fontmap)
 	return pango_font_metrics_new ();
 
-      info = g_new0 (PangoFcMetricsInfo, 1);
+      info = g_slice_new0 (PangoFcMetricsInfo);
       
-      fcfont->metrics_by_lang = g_slist_prepend (fcfont->metrics_by_lang, 
-						 info);
+      fcfont->metrics_by_lang = g_slist_prepend (fcfont->metrics_by_lang, info);
 	
       info->sample_str = sample_str;
 
Index: pango/pangocairo-fcfontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-fcfontmap.c,v
retrieving revision 1.6
diff -u -p -r1.6 pangocairo-fcfontmap.c
--- pango/pangocairo-fcfontmap.c	14 Jan 2006 07:00:11 -0000	1.6
+++ pango/pangocairo-fcfontmap.c	29 Jan 2006 22:57:44 -0000
@@ -195,7 +195,7 @@ pango_cairo_fc_font_map_init (PangoCairo
   cffontmap->library = NULL;
   error = FT_Init_FreeType (&cffontmap->library);
   if (error != FT_Err_Ok)
-    g_error ("pango_cairo_font_map_init: Could not initialize freetype");
+    g_critical ("pango_cairo_font_map_init: Could not initialize freetype");
 
   cffontmap->dpi   = 96.0;
 }
Index: pango/pangocairo-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-fontmap.c,v
retrieving revision 1.16
diff -u -p -r1.16 pangocairo-fontmap.c
--- pango/pangocairo-fontmap.c	21 Jan 2006 20:02:23 -0000	1.16
+++ pango/pangocairo-fontmap.c	29 Jan 2006 22:57:44 -0000
@@ -219,7 +219,7 @@ free_context_info (PangoCairoContextInfo
   if (info->merged_options)
     cairo_font_options_destroy (info->merged_options);
   
-  g_free (info);
+  g_slice_free (PangoCairoContextInfo, info);
 }
 
 static PangoCairoContextInfo *
@@ -236,7 +236,7 @@ get_context_info (PangoContext *context,
 
   if (!info && create)
     {
-      info = g_new (PangoCairoContextInfo, 1);
+      info = g_slice_new (PangoCairoContextInfo);
       info->dpi = -1.0;
       info->set_options = NULL;
       info->surface_options = NULL;
Index: pango/pangocairo-win32font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-win32font.c,v
retrieving revision 1.18
diff -u -p -r1.18 pangocairo-win32font.c
--- pango/pangocairo-win32font.c	27 Jan 2006 19:14:29 -0000	1.18
+++ pango/pangocairo-win32font.c	29 Jan 2006 22:57:45 -0000
@@ -165,7 +165,7 @@ static void
 free_metrics_info (PangoWin32MetricsInfo *info)
 {
   pango_font_metrics_unref (info->metrics);
-  g_free (info);
+  g_slice_free (PangoWin32MetricsInfo, info);
 }
 
 static void
@@ -347,7 +347,7 @@ pango_cairo_win32_font_get_metrics (Pang
       if (!win32font->fontmap)
 	return pango_font_metrics_new ();
 
-      info = g_new0 (PangoWin32MetricsInfo, 1);
+      info = g_slice_new0 (PangoWin32MetricsInfo);
       
       cwfont->metrics_by_lang = g_slist_prepend (cwfont->metrics_by_lang, 
 						 info);
Index: pango/pangofc-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangofc-font.c,v
retrieving revision 1.27
diff -u -p -r1.27 pangofc-font.c
--- pango/pangofc-font.c	21 Jan 2006 19:51:25 -0000	1.27
+++ pango/pangofc-font.c	29 Jan 2006 22:57:45 -0000
@@ -112,7 +112,7 @@ static void
 free_metrics_info (PangoFcMetricsInfo *info)
 {
   pango_font_metrics_unref (info->metrics);
-  g_free (info);
+  g_slice_free (PangoFcMetricsInfo, info);
 }
 
 static void
@@ -467,7 +467,7 @@ pango_fc_font_get_metrics (PangoFont    
       if (!fcfont->fontmap)
 	return pango_font_metrics_new ();
 
-      info = g_new0 (PangoFcMetricsInfo, 1);
+      info = g_slice_new0 (PangoFcMetricsInfo);
       
       fcfont->metrics_by_lang = g_slist_prepend (fcfont->metrics_by_lang, 
 						 info);
Index: pango/pangofc-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangofc-fontmap.c,v
retrieving revision 1.51
diff -u -p -r1.51 pangofc-fontmap.c
--- pango/pangofc-fontmap.c	29 Jan 2006 03:54:13 -0000	1.51
+++ pango/pangofc-fontmap.c	29 Jan 2006 22:57:45 -0000
@@ -353,13 +353,13 @@ fontset_hash_key_free (FontsetHashKey *k
     PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap,
 								  key->context_key);
   
-  g_free (key);
+  g_slice_free (FontsetHashKey, key);
 }
 
 static FontsetHashKey *
 fontset_hash_key_copy (FontsetHashKey *old)
 {
-  FontsetHashKey *key = g_new (FontsetHashKey, 1);
+  FontsetHashKey *key = g_slice_new (FontsetHashKey);
   
   key->fontmap = old->fontmap;
   key->matrix = old->matrix;
@@ -420,13 +420,13 @@ font_hash_key_free (FontHashKey *key)
     PANGO_FC_FONT_MAP_GET_CLASS (key->fontmap)->context_key_free (key->fontmap,
 								  key->context_key);
   
-  g_free (key);
+  g_slice_free (FontHashKey, key);
 }
 
 static FontHashKey *
 font_hash_key_copy (FontHashKey *old)
 {
-  FontHashKey *key = g_new (FontHashKey, 1);
+  FontHashKey *key = g_slice_new (FontHashKey);
   
   key->fontmap = old->fontmap;
   key->matrix = old->matrix;
@@ -466,7 +466,7 @@ pango_fc_font_map_add_decoder_find_func 
   PangoFcFontMapPrivate *priv = fcfontmap->priv;
   PangoFcFindFuncInfo *info;
 
-  info = g_new (PangoFcFindFuncInfo, 1);
+  info = g_slice_new (PangoFcFindFuncInfo);
 
   info->findfunc = findfunc;
   info->user_data = user_data;
@@ -501,7 +501,7 @@ pango_fc_font_map_finalize (GObject *obj
       if (info->dnotify)
 	info->dnotify (info->user_data);
 
-      g_free (info);
+      g_slice_free (PangoFcFindFuncInfo, info);
       priv->findfuncs = g_slist_delete_link (priv->findfuncs, priv->findfuncs);
     }
 
@@ -1073,7 +1073,7 @@ pango_fc_font_map_get_patterns (PangoFon
 	  exit (1);
 	}
 
-      patterns = g_new (PangoFcPatternSet, 1);
+      patterns = g_slice_new (PangoFcPatternSet);
       patterns->patterns = g_new (FcPattern *, font_patterns->nfont);
       patterns->n_patterns = 0;
       patterns->fontset = NULL;
@@ -1167,7 +1167,7 @@ pango_fc_pattern_set_free (PangoFcPatter
     FcPatternDestroy (patterns->patterns[i]);
 
   g_free (patterns->patterns);
-  g_free (patterns);
+  g_slice_free (PangoFcPatternSet, patterns);
 }
 
 static void
Index: pango/pangoft2-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoft2-fontmap.c,v
retrieving revision 1.60
diff -u -p -r1.60 pangoft2-fontmap.c
--- pango/pangoft2-fontmap.c	21 Jan 2006 19:51:25 -0000	1.60
+++ pango/pangoft2-fontmap.c	29 Jan 2006 22:57:45 -0000
@@ -133,7 +133,7 @@ pango_ft2_font_map_new (void)
   
   error = FT_Init_FreeType (&ft2fontmap->library);
   if (error != FT_Err_Ok)
-    g_error ("pango_ft2_font_map_new: Could not initialize freetype");
+    g_critical ("pango_ft2_font_map_new: Could not initialize freetype");
 
   return (PangoFontMap *)ft2fontmap;
 }
Index: pango/pangoft2-render.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoft2-render.c,v
retrieving revision 1.9
diff -u -p -r1.9 pangoft2-render.c
--- pango/pangoft2-render.c	28 Jan 2006 20:02:01 -0000	1.9
+++ pango/pangoft2-render.c	29 Jan 2006 22:57:45 -0000
@@ -96,7 +96,7 @@ static void
 pango_ft2_free_rendered_glyph (PangoFT2RenderedGlyph *rendered)
 {
   g_free (rendered->bitmap.buffer);
-  g_free (rendered);
+  g_slice_free (PangoFT2RenderedGlyph, rendered);
 }
 
 static PangoFT2RenderedGlyph *
@@ -106,7 +106,7 @@ pango_ft2_font_render_glyph (PangoFont *
   PangoFT2RenderedGlyph *rendered;
   FT_Face face;
 
-  rendered = g_new (PangoFT2RenderedGlyph, 1);
+  rendered = g_slice_new (PangoFT2RenderedGlyph);
 
   face = pango_ft2_font_get_face (font);
   
@@ -127,7 +127,7 @@ pango_ft2_font_render_glyph (PangoFont *
       rendered->bitmap_top = face->glyph->bitmap_top;
     }
   else
-    g_error ("Couldn't get face for PangoFT2Face");
+    g_warning ("couldn't get face for PangoFT2Face, expect ugly output");
 
   return rendered;
 }
Index: pango/pangoft2.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoft2.c,v
retrieving revision 1.79
diff -u -p -r1.79 pangoft2.c
--- pango/pangoft2.c	14 Jan 2006 07:00:11 -0000	1.79
+++ pango/pangoft2.c	29 Jan 2006 22:57:45 -0000
@@ -275,7 +275,7 @@ pango_ft2_font_get_glyph_info (PangoFont
 
   if ((info == NULL) && create)
     {
-       info = g_new0 (PangoFT2GlyphInfo, 1);
+      info = g_slice_new0 (PangoFT2GlyphInfo);
 
       pango_fc_font_get_raw_extents (fcfont, ft2font->load_flags,
 				     glyph,
@@ -378,7 +378,7 @@ pango_ft2_free_glyph_info_callback (gpoi
   if (font->glyph_cache_destroy && info->cached_glyph)
     (*font->glyph_cache_destroy) (info->cached_glyph);
 
-  g_free (value);
+  g_slice_free (PangoFT2GlyphInfo, info);
   return TRUE;
 }
 
Index: pango/pangowin32-fontcache.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangowin32-fontcache.c,v
retrieving revision 1.12
diff -u -p -r1.12 pangowin32-fontcache.c
--- pango/pangowin32-fontcache.c	14 Jan 2006 07:00:11 -0000	1.12
+++ pango/pangowin32-fontcache.c	29 Jan 2006 22:57:45 -0000
@@ -61,7 +61,7 @@ free_cache_entry (LOGFONT             *l
   if (!DeleteObject (entry->hfont))
     PING (("DeleteObject for hfont %p failed", entry->hfont));
 
-  g_free (entry);
+  g_slice_free (CacheEntry, entry);
 }
 
 /**
@@ -82,6 +82,8 @@ pango_win32_font_cache_free (PangoWin32F
   g_hash_table_destroy (cache->back);
 
   g_list_free (cache->mru);
+
+  g_slice_free (PangoWin32FontCache, cache);
 }
 
 static guint
@@ -127,7 +129,7 @@ pango_win32_font_cache_new (void)
 {
   PangoWin32FontCache *cache;
 
-  cache = g_new (PangoWin32FontCache, 1);
+  cache = g_slice_new (PangoWin32FontCache);
 
   cache->forward = g_hash_table_new (logfont_hash, logfont_equal);
   cache->back = g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -290,7 +292,7 @@ pango_win32_font_cache_load (PangoWin32F
       if (!hfont)
 	return NULL;
       
-      entry = g_new (CacheEntry, 1);
+      entry = g_slice_new (CacheEntry);
 
       entry->logfont = lf;
       entry->hfont = hfont;
Index: pango/pangoxft-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoxft-font.c,v
retrieving revision 1.66
diff -u -p -r1.66 pangoxft-font.c
--- pango/pangoxft-font.c	21 Jan 2006 19:51:25 -0000	1.66
+++ pango/pangoxft-font.c	29 Jan 2006 22:57:45 -0000
@@ -269,6 +269,12 @@ typedef struct
 } Extents;
 
 static void
+extents_free (Extents *ext)
+{
+  g_slice_free (Extents, ext);
+}
+
+static void
 get_glyph_extents_raw (PangoXftFont     *xfont,
 		       PangoGlyph        glyph,
 		       PangoRectangle   *ink_rect,
@@ -278,14 +284,14 @@ get_glyph_extents_raw (PangoXftFont     
 
   if (!xfont->glyph_info)
     xfont->glyph_info = g_hash_table_new_full (NULL, NULL,
-					       NULL, (GDestroyNotify)g_free);
+					       NULL, (GDestroyNotify)extents_free);
 
   extents = g_hash_table_lookup (xfont->glyph_info,
 				 GUINT_TO_POINTER (glyph));
 
   if (!extents)
     {
-      extents = g_new (Extents, 1);
+      extents = g_slice_new (Extents);
      
       pango_fc_font_get_raw_extents (PANGO_FC_FONT (xfont),
 				     FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING,
Index: pango/pangoxft-render.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoxft-render.c,v
retrieving revision 1.9
diff -u -p -r1.9 pangoxft-render.c
--- pango/pangoxft-render.c	28 Jan 2006 20:02:01 -0000	1.9
+++ pango/pangoxft-render.c	29 Jan 2006 22:57:45 -0000
@@ -409,7 +409,7 @@ pango_xft_renderer_draw_glyph (PangoRend
 			       double           x,
 			       double           y)
 {
-  g_error ("pango_xft_renderer_draw_glyph(): should not be called\n");
+  g_critical ("pango_xft_renderer_draw_glyph(): should not be called");
 }
 
 static void

