summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-09-07 23:26:49 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-09-07 23:26:49 +0000
commited419fa5c98ca55f2a8dd0fea06633512964b2df (patch)
treee9d00bb45c39a0ccbdd95555930afad18a104172
parent4e9d86a3e715f6c0806a2019def34153b02dea1c (diff)
downloadpango-ed419fa5c98ca55f2a8dd0fea06633512964b2df.tar.gz
Switch some g_new (*, 1) to g_slice_new ()... I know...
2007-09-07 Behdad Esfahbod <behdad@gnome.org> * pango/pangox-fontcache.c (free_cache_entry), (pango_x_font_cache_free), (pango_x_font_cache_new), (pango_x_font_cache_load): * pango/pangox-fontmap.c (pango_x_font_map_finalize), (pango_x_insert_font): * pango/pangox.c (free_context_info), (pango_x_get_context), (pango_x_font_init), (pango_x_font_get_metrics), (pango_x_insert_subfont), (free_metrics_info), (pango_x_font_finalize): Switch some g_new (*, 1) to g_slice_new ()... I know... svn path=/trunk/; revision=2422
-rw-r--r--ChangeLog13
-rw-r--r--pango/pango-ot-info.c4
-rw-r--r--pango/pangox-fontcache.c8
-rw-r--r--pango/pangox-fontmap.c9
4 files changed, 27 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 26a5b9e1..392af7e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2007-09-07 Behdad Esfahbod <behdad@gnome.org>
+ * pango/pangox-fontcache.c (free_cache_entry),
+ (pango_x_font_cache_free), (pango_x_font_cache_new),
+ (pango_x_font_cache_load):
+ * pango/pangox-fontmap.c (pango_x_font_map_finalize),
+ (pango_x_insert_font):
+ * pango/pangox.c (free_context_info), (pango_x_get_context),
+ (pango_x_font_init), (pango_x_font_get_metrics),
+ (pango_x_insert_subfont), (free_metrics_info),
+ (pango_x_font_finalize):
+ Switch some g_new (*, 1) to g_slice_new ()... I know...
+
+2007-09-07 Behdad Esfahbod <behdad@gnome.org>
+
Patch from Chris Wilson
* pango/pangoft2.c (load_fallback_face): Use g_error() instead
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 73779370..88c0af5a 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -697,7 +697,7 @@ pango_ot_info_list_languages (PangoOTInfo *info,
if (script_index == PANGO_OT_NO_SCRIPT)
{
- result = g_new (PangoOTTag, 1);
+ result = g_new (PangoOTTag, 0+1);
result[0] = 0;
return result;
}
@@ -754,7 +754,7 @@ pango_ot_info_list_features (PangoOTInfo *info,
if (script_index == PANGO_OT_NO_SCRIPT)
{
- result = g_new (PangoOTTag, 1);
+ result = g_new (PangoOTTag, 0+1);
result[0] = 0;
return result;
}
diff --git a/pango/pangox-fontcache.c b/pango/pangox-fontcache.c
index ed556e74..8b169fab 100644
--- a/pango/pangox-fontcache.c
+++ b/pango/pangox-fontcache.c
@@ -60,7 +60,7 @@ free_cache_entry (char *xlfd,
g_free (entry->xlfd);
XFreeFont (cache->display, entry->fs);
- g_free (entry);
+ g_slice_free (CacheEntry, entry);
}
/**
@@ -81,6 +81,8 @@ pango_x_font_cache_free (PangoXFontCache *cache)
g_hash_table_destroy (cache->back);
g_list_free (cache->mru);
+
+ g_slice_free (PangoXFontCache, cache);
}
/**
@@ -99,7 +101,7 @@ pango_x_font_cache_new (Display *display)
g_return_val_if_fail (display != NULL, NULL);
- cache = g_new (PangoXFontCache, 1);
+ cache = g_slice_new (PangoXFontCache);
cache->display = display;
@@ -161,7 +163,7 @@ pango_x_font_cache_load (PangoXFontCache *cache,
if (!fs)
return NULL;
- entry = g_new (CacheEntry, 1);
+ entry = g_slice_new (CacheEntry);
entry->xlfd = g_strdup (xlfd);
entry->fs = fs;
diff --git a/pango/pangox-fontmap.c b/pango/pangox-fontmap.c
index 3681b939..b4f5043f 100644
--- a/pango/pangox-fontmap.c
+++ b/pango/pangox-fontmap.c
@@ -374,7 +374,12 @@ pango_x_font_map_finalize (GObject *object)
pango_x_font_cache_free (xfontmap->font_cache);
- /* FIXME: Lots more here */
+ /* FIXME: None of these hashtables free their key/values
+ g_hash_table_destroy (xfontmap->families);
+ g_hash_table_destroy (xfontmap->size_infos);
+ g_hash_table_destroy (xfontmap->to_atom_cache);
+ g_hash_table_destroy (xfontmap->from_atom_cache);
+ */
fontmaps = g_list_remove (fontmaps, xfontmap);
@@ -1100,7 +1105,7 @@ pango_x_insert_font (PangoXFontMap *xfontmap,
size_info = g_hash_table_lookup (xfontmap->size_infos, identifier);
if (!size_info)
{
- size_info = g_new (PangoXSizeInfo, 1);
+ size_info = g_slice_new (PangoXSizeInfo);
size_info->identifier = identifier;
size_info->xlfds = NULL;