app/core/gimppalette-import.c app/core/gimppalette-load.c use GSlice for

2007-05-22  Sven Neumann  <sven@gimp.org>

	* app/core/gimppalette-import.c
	* app/core/gimppalette-load.c
	* app/core/gimppalette.c: use GSlice for palette entries and
	temporary structs.


svn path=/trunk/; revision=22587
This commit is contained in:
Sven Neumann 2007-05-22 21:59:19 +00:00 committed by Sven Neumann
parent dc94d7b2f6
commit cd772f930a
4 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2007-05-22 Sven Neumann <sven@gimp.org>
* app/core/gimppalette-import.c
* app/core/gimppalette-load.c
* app/core/gimppalette.c: use GSlice for palette entries and
temporary structs.
2007-05-22 Sven Neumann <sven@gimp.org>
* app/base/siox.c: allocate structs using GSlice.

View File

@ -127,7 +127,7 @@ gimp_palette_import_store_colors (GHashTable *table,
count_color_entries++;
new_color = g_new (ImgColors, 1);
new_color = g_slice_new (ImgColors);
new_color->count = 1;
new_color->r_adj = 0;
@ -229,6 +229,7 @@ gimp_palette_import_make_palette (GHashTable *table,
{
GimpPalette *palette = GIMP_PALETTE (gimp_palette_new (palette_name));
GSList *list = NULL;
GSList *iter;
if (! table)
return palette;
@ -249,7 +250,8 @@ gimp_palette_import_make_palette (GHashTable *table,
*/
g_hash_table_destroy (table);
g_slist_foreach (list, (GFunc) g_free, NULL);
for (iter = list; iter; iter = iter->next)
g_slice_free (ImgColors, iter->data);
g_slist_free (list);

View File

@ -212,7 +212,7 @@ gimp_palette_load (const gchar *filename,
gimp_filename_to_utf8 (filename), linenum);
/* don't call gimp_palette_add_entry here, it's rather inefficient */
entry = g_new0 (GimpPaletteEntry, 1);
entry = g_slice_new0 (GimpPaletteEntry);
gimp_rgba_set_uchar (&entry->color,
(guchar) r,

View File

@ -327,7 +327,7 @@ gimp_palette_add_entry (GimpPalette *palette,
g_return_val_if_fail (GIMP_IS_PALETTE (palette), NULL);
g_return_val_if_fail (color != NULL, NULL);
entry = g_new0 (GimpPaletteEntry, 1);
entry = g_slice_new0 (GimpPaletteEntry);
entry->color = *color;
entry->name = g_strdup (name ? name : _("Untitled"));
@ -493,7 +493,8 @@ gimp_palette_entry_free (GimpPaletteEntry *entry)
g_return_if_fail (entry != NULL);
g_free (entry->name);
g_free (entry);
g_slice_free (GimpPaletteEntry, entry);
}
static gint64