From 980ba7f85afa4271da06c5e80557f6be09c1f0f4 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 12 Aug 2014 13:57:57 +0200 Subject: [PATCH] app: move memsize functions into their own files gimp-memsize.[ch] --- app/core/Makefile.am | 2 + app/core/gimp-memsize.c | 306 ++++++++++++++++++++++++++++++ app/core/gimp-memsize.h | 54 ++++++ app/core/gimp-utils.c | 276 --------------------------- app/core/gimp-utils.h | 27 --- app/core/gimp.c | 1 + app/core/gimpbuffer.c | 2 +- app/core/gimpcontainer.c | 2 +- app/core/gimpcontext.c | 2 +- app/core/gimpdata.c | 2 +- app/core/gimpdrawable.c | 1 + app/core/gimpdrawablemodundo.c | 2 +- app/core/gimpdrawableundo.c | 2 +- app/core/gimpfilter.c | 2 +- app/core/gimpidtable.c | 2 +- app/core/gimpimage.c | 2 +- app/core/gimpimageundo.c | 2 +- app/core/gimpitempropundo.c | 2 +- app/core/gimpmaskundo.c | 2 +- app/core/gimpobject.c | 2 +- app/core/gimppalette.c | 2 +- app/core/gimpparasitelist.c | 2 +- app/core/gimpprojection.c | 2 +- app/core/gimptagcache.c | 2 +- app/core/gimpviewable.c | 2 +- app/pdb/gimppdb.c | 2 +- app/pdb/gimpprocedure.c | 2 +- app/plug-in/gimpplugindef.c | 2 +- app/plug-in/gimppluginmanager.c | 2 +- app/plug-in/gimppluginprocedure.c | 2 +- app/text/gimptext.c | 3 +- app/text/gimptextundo.c | 2 +- app/vectors/gimpstroke.c | 2 +- 33 files changed, 391 insertions(+), 329 deletions(-) create mode 100644 app/core/gimp-memsize.c create mode 100644 app/core/gimp-memsize.h diff --git a/app/core/Makefile.am b/app/core/Makefile.am index 3fbf897e5a..e5b44d8e5d 100644 --- a/app/core/Makefile.am +++ b/app/core/Makefile.am @@ -37,6 +37,8 @@ libappcore_a_sources = \ gimp-gradients.h \ gimp-gui.c \ gimp-gui.h \ + gimp-memsize.c \ + gimp-memsize.h \ gimp-modules.c \ gimp-modules.h \ gimp-parasites.c \ diff --git a/app/core/gimp-memsize.c b/app/core/gimp-memsize.c new file mode 100644 index 0000000000..b88a9ac012 --- /dev/null +++ b/app/core/gimp-memsize.c @@ -0,0 +1,306 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "config.h" + +#include + +#include +#include +#include + +#include "libgimpbase/gimpbase.h" +#include "libgimpmath/gimpmath.h" +#include "libgimpcolor/gimpcolor.h" + +#include "core-types.h" + +#include "gimp-memsize.h" +#include "gimpparamspecs.h" + + +gint64 +gimp_g_type_instance_get_memsize (GTypeInstance *instance) +{ + if (instance) + { + GTypeQuery type_query; + + g_type_query (G_TYPE_FROM_INSTANCE (instance), &type_query); + + return type_query.instance_size; + } + + return 0; +} + +gint64 +gimp_g_object_get_memsize (GObject *object) +{ + if (object) + return gimp_g_type_instance_get_memsize ((GTypeInstance *) object); + + return 0; +} + +gint64 +gimp_g_hash_table_get_memsize (GHashTable *hash, + gint64 data_size) +{ + if (hash) + return (2 * sizeof (gint) + + 5 * sizeof (gpointer) + + g_hash_table_size (hash) * (3 * sizeof (gpointer) + data_size)); + + return 0; +} + +typedef struct +{ + GimpMemsizeFunc func; + gint64 memsize; + gint64 gui_size; +} HashMemsize; + +static void +hash_memsize_foreach (gpointer key, + gpointer value, + HashMemsize *memsize) +{ + gint64 gui_size = 0; + + memsize->memsize += memsize->func (value, &gui_size); + memsize->gui_size += gui_size; +} + +gint64 +gimp_g_hash_table_get_memsize_foreach (GHashTable *hash, + GimpMemsizeFunc func, + gint64 *gui_size) +{ + HashMemsize memsize; + + g_return_val_if_fail (func != NULL, 0); + + if (! hash) + return 0; + + memsize.func = func; + memsize.memsize = 0; + memsize.gui_size = 0; + + g_hash_table_foreach (hash, (GHFunc) hash_memsize_foreach, &memsize); + + if (gui_size) + *gui_size = memsize.gui_size; + + return memsize.memsize + gimp_g_hash_table_get_memsize (hash, 0); +} + +gint64 +gimp_g_slist_get_memsize (GSList *slist, + gint64 data_size) +{ + return g_slist_length (slist) * (data_size + sizeof (GSList)); +} + +gint64 +gimp_g_slist_get_memsize_foreach (GSList *slist, + GimpMemsizeFunc func, + gint64 *gui_size) +{ + GSList *l; + gint64 memsize = 0; + + g_return_val_if_fail (func != NULL, 0); + + for (l = slist; l; l = g_slist_next (l)) + memsize += sizeof (GSList) + func (l->data, gui_size); + + return memsize; +} + +gint64 +gimp_g_list_get_memsize (GList *list, + gint64 data_size) +{ + return g_list_length (list) * (data_size + sizeof (GList)); +} + +gint64 +gimp_g_list_get_memsize_foreach (GList *list, + GimpMemsizeFunc func, + gint64 *gui_size) +{ + GList *l; + gint64 memsize = 0; + + g_return_val_if_fail (func != NULL, 0); + + for (l = list; l; l = g_list_next (l)) + memsize += sizeof (GList) + func (l->data, gui_size); + + return memsize; +} + +gint64 +gimp_g_value_get_memsize (GValue *value) +{ + gint64 memsize = 0; + + if (! value) + return 0; + + if (G_VALUE_HOLDS_STRING (value)) + { + memsize += gimp_string_get_memsize (g_value_get_string (value)); + } + else if (G_VALUE_HOLDS_BOXED (value)) + { + if (GIMP_VALUE_HOLDS_RGB (value)) + { + memsize += sizeof (GimpRGB); + } + else if (GIMP_VALUE_HOLDS_MATRIX2 (value)) + { + memsize += sizeof (GimpMatrix2); + } + else if (GIMP_VALUE_HOLDS_PARASITE (value)) + { + memsize += gimp_parasite_get_memsize (g_value_get_boxed (value), + NULL); + } + else if (GIMP_VALUE_HOLDS_ARRAY (value) || + GIMP_VALUE_HOLDS_INT8_ARRAY (value) || + GIMP_VALUE_HOLDS_INT16_ARRAY (value) || + GIMP_VALUE_HOLDS_INT32_ARRAY (value) || + GIMP_VALUE_HOLDS_FLOAT_ARRAY (value)) + { + GimpArray *array = g_value_get_boxed (value); + + if (array) + memsize += (sizeof (GimpArray) + + array->static_data ? 0 : array->length); + } + else if (GIMP_VALUE_HOLDS_STRING_ARRAY (value)) + { + GimpArray *array = g_value_get_boxed (value); + + if (array) + { + memsize += sizeof (GimpArray); + + if (! array->static_data) + { + gchar **tmp = (gchar **) array->data; + gint i; + + memsize += array->length * sizeof (gchar *); + + for (i = 0; i < array->length; i++) + memsize += gimp_string_get_memsize (tmp[i]); + } + } + } + else + { + g_printerr ("%s: unhandled boxed value type: %s\n", + G_STRFUNC, G_VALUE_TYPE_NAME (value)); + } + } + else if (G_VALUE_HOLDS_OBJECT (value)) + { + g_printerr ("%s: unhandled object value type: %s\n", + G_STRFUNC, G_VALUE_TYPE_NAME (value)); + } + + return memsize + sizeof (GValue); +} + +gint64 +gimp_g_param_spec_get_memsize (GParamSpec *pspec) +{ + gint64 memsize = 0; + + if (! pspec) + return 0; + + if (! (pspec->flags & G_PARAM_STATIC_NAME)) + memsize += gimp_string_get_memsize (g_param_spec_get_name (pspec)); + + if (! (pspec->flags & G_PARAM_STATIC_NICK)) + memsize += gimp_string_get_memsize (g_param_spec_get_nick (pspec)); + + if (! (pspec->flags & G_PARAM_STATIC_BLURB)) + memsize += gimp_string_get_memsize (g_param_spec_get_blurb (pspec)); + + return memsize + gimp_g_type_instance_get_memsize ((GTypeInstance *) pspec); +} + +gint64 +gimp_gegl_buffer_get_memsize (GeglBuffer *buffer) +{ + if (buffer) + { + const Babl *format = gegl_buffer_get_format (buffer); + + return (babl_format_get_bytes_per_pixel (format) * + gegl_buffer_get_width (buffer) * + gegl_buffer_get_height (buffer) + + gimp_g_object_get_memsize (G_OBJECT (buffer))); + } + + return 0; +} + +gint64 +gimp_gegl_pyramid_get_memsize (GeglBuffer *buffer) +{ + if (buffer) + { + const Babl *format = gegl_buffer_get_format (buffer); + + /* The pyramid levels constitute a geometric sum with a ratio of 1/4. */ + return ((gint64) babl_format_get_bytes_per_pixel (format) * + (gint64) gegl_buffer_get_width (buffer) * + (gint64) gegl_buffer_get_height (buffer) * 1.33 + + gimp_g_object_get_memsize (G_OBJECT (buffer))); + } + + return 0; +} + +gint64 +gimp_string_get_memsize (const gchar *string) +{ + if (string) + return strlen (string) + 1; + + return 0; +} + +gint64 +gimp_parasite_get_memsize (GimpParasite *parasite, + gint64 *gui_size) +{ + if (parasite) + return (sizeof (GimpParasite) + + gimp_string_get_memsize (parasite->name) + + parasite->size); + + return 0; +} diff --git a/app/core/gimp-memsize.h b/app/core/gimp-memsize.h new file mode 100644 index 0000000000..ffc929fabb --- /dev/null +++ b/app/core/gimp-memsize.h @@ -0,0 +1,54 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __APP_GIMP_MEMSIZE_H__ +#define __APP_GIMP_MEMSIZE_H__ + + +gint64 gimp_g_type_instance_get_memsize (GTypeInstance *instance); +gint64 gimp_g_object_get_memsize (GObject *object); + +gint64 gimp_g_hash_table_get_memsize (GHashTable *hash, + gint64 data_size); +gint64 gimp_g_hash_table_get_memsize_foreach (GHashTable *hash, + GimpMemsizeFunc func, + gint64 *gui_size); + +gint64 gimp_g_slist_get_memsize (GSList *slist, + gint64 data_size); +gint64 gimp_g_slist_get_memsize_foreach (GSList *slist, + GimpMemsizeFunc func, + gint64 *gui_size); + +gint64 gimp_g_list_get_memsize (GList *list, + gint64 data_size); +gint64 gimp_g_list_get_memsize_foreach (GList *slist, + GimpMemsizeFunc func, + gint64 *gui_size); + +gint64 gimp_g_value_get_memsize (GValue *value); +gint64 gimp_g_param_spec_get_memsize (GParamSpec *pspec); + +gint64 gimp_gegl_buffer_get_memsize (GeglBuffer *buffer); +gint64 gimp_gegl_pyramid_get_memsize (GeglBuffer *buffer); + +gint64 gimp_string_get_memsize (const gchar *string); +gint64 gimp_parasite_get_memsize (GimpParasite *parasite, + gint64 *gui_size); + + +#endif /* __APP_GIMP_MEMSIZE_H__ */ diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c index e546aa6b76..145a609ad1 100644 --- a/app/core/gimp-utils.c +++ b/app/core/gimp-utils.c @@ -53,16 +53,13 @@ #include "libgimpbase/gimpbase.h" #include "libgimpmath/gimpmath.h" #include "libgimpcolor/gimpcolor.h" -#include "libgimpconfig/gimpconfig.h" #include "core-types.h" #include "gimp.h" #include "gimp-utils.h" -#include "gimpcontainer.h" #include "gimpcontext.h" #include "gimperror.h" -#include "gimpparamspecs.h" #include "gimp-intl.h" @@ -70,279 +67,6 @@ #define MAX_FUNC 100 -gint64 -gimp_g_type_instance_get_memsize (GTypeInstance *instance) -{ - if (instance) - { - GTypeQuery type_query; - - g_type_query (G_TYPE_FROM_INSTANCE (instance), &type_query); - - return type_query.instance_size; - } - - return 0; -} - -gint64 -gimp_g_object_get_memsize (GObject *object) -{ - if (object) - return gimp_g_type_instance_get_memsize ((GTypeInstance *) object); - - return 0; -} - -gint64 -gimp_g_hash_table_get_memsize (GHashTable *hash, - gint64 data_size) -{ - if (hash) - return (2 * sizeof (gint) + - 5 * sizeof (gpointer) + - g_hash_table_size (hash) * (3 * sizeof (gpointer) + data_size)); - - return 0; -} - -typedef struct -{ - GimpMemsizeFunc func; - gint64 memsize; - gint64 gui_size; -} HashMemsize; - -static void -hash_memsize_foreach (gpointer key, - gpointer value, - HashMemsize *memsize) -{ - gint64 gui_size = 0; - - memsize->memsize += memsize->func (value, &gui_size); - memsize->gui_size += gui_size; -} - -gint64 -gimp_g_hash_table_get_memsize_foreach (GHashTable *hash, - GimpMemsizeFunc func, - gint64 *gui_size) -{ - HashMemsize memsize; - - g_return_val_if_fail (func != NULL, 0); - - if (! hash) - return 0; - - memsize.func = func; - memsize.memsize = 0; - memsize.gui_size = 0; - - g_hash_table_foreach (hash, (GHFunc) hash_memsize_foreach, &memsize); - - if (gui_size) - *gui_size = memsize.gui_size; - - return memsize.memsize + gimp_g_hash_table_get_memsize (hash, 0); -} - -gint64 -gimp_g_slist_get_memsize (GSList *slist, - gint64 data_size) -{ - return g_slist_length (slist) * (data_size + sizeof (GSList)); -} - -gint64 -gimp_g_slist_get_memsize_foreach (GSList *slist, - GimpMemsizeFunc func, - gint64 *gui_size) -{ - GSList *l; - gint64 memsize = 0; - - g_return_val_if_fail (func != NULL, 0); - - for (l = slist; l; l = g_slist_next (l)) - memsize += sizeof (GSList) + func (l->data, gui_size); - - return memsize; -} - -gint64 -gimp_g_list_get_memsize (GList *list, - gint64 data_size) -{ - return g_list_length (list) * (data_size + sizeof (GList)); -} - -gint64 -gimp_g_list_get_memsize_foreach (GList *list, - GimpMemsizeFunc func, - gint64 *gui_size) -{ - GList *l; - gint64 memsize = 0; - - g_return_val_if_fail (func != NULL, 0); - - for (l = list; l; l = g_list_next (l)) - memsize += sizeof (GList) + func (l->data, gui_size); - - return memsize; -} - -gint64 -gimp_g_value_get_memsize (GValue *value) -{ - gint64 memsize = 0; - - if (! value) - return 0; - - if (G_VALUE_HOLDS_STRING (value)) - { - memsize += gimp_string_get_memsize (g_value_get_string (value)); - } - else if (G_VALUE_HOLDS_BOXED (value)) - { - if (GIMP_VALUE_HOLDS_RGB (value)) - { - memsize += sizeof (GimpRGB); - } - else if (GIMP_VALUE_HOLDS_MATRIX2 (value)) - { - memsize += sizeof (GimpMatrix2); - } - else if (GIMP_VALUE_HOLDS_PARASITE (value)) - { - memsize += gimp_parasite_get_memsize (g_value_get_boxed (value), - NULL); - } - else if (GIMP_VALUE_HOLDS_ARRAY (value) || - GIMP_VALUE_HOLDS_INT8_ARRAY (value) || - GIMP_VALUE_HOLDS_INT16_ARRAY (value) || - GIMP_VALUE_HOLDS_INT32_ARRAY (value) || - GIMP_VALUE_HOLDS_FLOAT_ARRAY (value)) - { - GimpArray *array = g_value_get_boxed (value); - - if (array) - memsize += (sizeof (GimpArray) + - array->static_data ? 0 : array->length); - } - else if (GIMP_VALUE_HOLDS_STRING_ARRAY (value)) - { - GimpArray *array = g_value_get_boxed (value); - - if (array) - { - memsize += sizeof (GimpArray); - - if (! array->static_data) - { - gchar **tmp = (gchar **) array->data; - gint i; - - memsize += array->length * sizeof (gchar *); - - for (i = 0; i < array->length; i++) - memsize += gimp_string_get_memsize (tmp[i]); - } - } - } - else - { - g_printerr ("%s: unhandled boxed value type: %s\n", - G_STRFUNC, G_VALUE_TYPE_NAME (value)); - } - } - else if (G_VALUE_HOLDS_OBJECT (value)) - { - g_printerr ("%s: unhandled object value type: %s\n", - G_STRFUNC, G_VALUE_TYPE_NAME (value)); - } - - return memsize + sizeof (GValue); -} - -gint64 -gimp_g_param_spec_get_memsize (GParamSpec *pspec) -{ - gint64 memsize = 0; - - if (! pspec) - return 0; - - if (! (pspec->flags & G_PARAM_STATIC_NAME)) - memsize += gimp_string_get_memsize (g_param_spec_get_name (pspec)); - - if (! (pspec->flags & G_PARAM_STATIC_NICK)) - memsize += gimp_string_get_memsize (g_param_spec_get_nick (pspec)); - - if (! (pspec->flags & G_PARAM_STATIC_BLURB)) - memsize += gimp_string_get_memsize (g_param_spec_get_blurb (pspec)); - - return memsize + gimp_g_type_instance_get_memsize ((GTypeInstance *) pspec); -} - -gint64 -gimp_gegl_buffer_get_memsize (GeglBuffer *buffer) -{ - if (buffer) - { - const Babl *format = gegl_buffer_get_format (buffer); - - return (babl_format_get_bytes_per_pixel (format) * - gegl_buffer_get_width (buffer) * - gegl_buffer_get_height (buffer) + - gimp_g_object_get_memsize (G_OBJECT (buffer))); - } - - return 0; -} - -gint64 -gimp_gegl_pyramid_get_memsize (GeglBuffer *buffer) -{ - if (buffer) - { - const Babl *format = gegl_buffer_get_format (buffer); - - /* The pyramid levels constitute a geometric sum with a ratio of 1/4. */ - return ((gint64) babl_format_get_bytes_per_pixel (format) * - (gint64) gegl_buffer_get_width (buffer) * - (gint64) gegl_buffer_get_height (buffer) * 1.33 + - gimp_g_object_get_memsize (G_OBJECT (buffer))); - } - - return 0; -} - -gint64 -gimp_string_get_memsize (const gchar *string) -{ - if (string) - return strlen (string) + 1; - - return 0; -} - -gint64 -gimp_parasite_get_memsize (GimpParasite *parasite, - gint64 *gui_size) -{ - if (parasite) - return (sizeof (GimpParasite) + - gimp_string_get_memsize (parasite->name) + - parasite->size); - - return 0; -} - - gint gimp_get_pid (void) { diff --git a/app/core/gimp-utils.h b/app/core/gimp-utils.h index 370487fa4a..df1f90e452 100644 --- a/app/core/gimp-utils.h +++ b/app/core/gimp-utils.h @@ -32,33 +32,6 @@ #define MAX4(a,b,c,d) MAX (MAX ((a), (b)), MAX ((c), (d))) -gint64 gimp_g_type_instance_get_memsize (GTypeInstance *instance); -gint64 gimp_g_object_get_memsize (GObject *object); -gint64 gimp_g_hash_table_get_memsize (GHashTable *hash, - gint64 data_size); -gint64 gimp_g_hash_table_get_memsize_foreach (GHashTable *hash, - GimpMemsizeFunc func, - gint64 *gui_size); -gint64 gimp_g_slist_get_memsize (GSList *slist, - gint64 data_size); -gint64 gimp_g_slist_get_memsize_foreach (GSList *slist, - GimpMemsizeFunc func, - gint64 *gui_size); -gint64 gimp_g_list_get_memsize (GList *list, - gint64 data_size); -gint64 gimp_g_list_get_memsize_foreach (GList *slist, - GimpMemsizeFunc func, - gint64 *gui_size); -gint64 gimp_g_value_get_memsize (GValue *value); -gint64 gimp_g_param_spec_get_memsize (GParamSpec *pspec); - -gint64 gimp_gegl_buffer_get_memsize (GeglBuffer *buffer); -gint64 gimp_gegl_pyramid_get_memsize (GeglBuffer *buffer); - -gint64 gimp_string_get_memsize (const gchar *string); -gint64 gimp_parasite_get_memsize (GimpParasite *parasite, - gint64 *gui_size); - gint gimp_get_pid (void); guint64 gimp_get_physical_memory_size (void); gchar * gimp_get_backtrace (void); diff --git a/app/core/gimp.c b/app/core/gimp.c index 65d71bb472..7bfc38fdbf 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -45,6 +45,7 @@ #include "gimp.h" #include "gimp-contexts.h" #include "gimp-gradients.h" +#include "gimp-memsize.h" #include "gimp-modules.h" #include "gimp-parasites.h" #include "gimp-templates.h" diff --git a/app/core/gimpbuffer.c b/app/core/gimpbuffer.c index fb7375a273..e805cd2aff 100644 --- a/app/core/gimpbuffer.c +++ b/app/core/gimpbuffer.c @@ -27,7 +27,7 @@ #include "gegl/gimp-babl.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpbuffer.h" #include "gimpimage.h" #include "gimptempbuf.h" diff --git a/app/core/gimpcontainer.c b/app/core/gimpcontainer.c index 38c98c4a8e..9b92040061 100644 --- a/app/core/gimpcontainer.c +++ b/app/core/gimpcontainer.c @@ -28,7 +28,7 @@ #include "core-types.h" #include "gimp.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpcontainer.h" #include "gimpmarshal.h" diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 474091e62b..f962f9ce25 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -33,7 +33,7 @@ #include "config/gimpcoreconfig.h" #include "gimp.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpbrush.h" #include "gimpbuffer.h" #include "gimpcontainer.h" diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c index 409b1abd40..14dcc632dd 100644 --- a/app/core/gimpdata.c +++ b/app/core/gimpdata.c @@ -27,7 +27,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpdata.h" #include "gimpmarshal.h" #include "gimptag.h" diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 110756a755..f456a30a48 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -32,6 +32,7 @@ #include "gegl/gimp-gegl-apply-operation.h" #include "gegl/gimp-gegl-utils.h" +#include "gimp-memsize.h" #include "gimp-utils.h" #include "gimpchannel.h" #include "gimpcontext.h" diff --git a/app/core/gimpdrawablemodundo.c b/app/core/gimpdrawablemodundo.c index 1c8d951343..c0e8dcf81a 100644 --- a/app/core/gimpdrawablemodundo.c +++ b/app/core/gimpdrawablemodundo.c @@ -24,7 +24,7 @@ #include "gegl/gimp-gegl-utils.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpimage.h" #include "gimpdrawable.h" #include "gimpdrawablemodundo.h" diff --git a/app/core/gimpdrawableundo.c b/app/core/gimpdrawableundo.c index b415a42f76..7c0f6f40de 100644 --- a/app/core/gimpdrawableundo.c +++ b/app/core/gimpdrawableundo.c @@ -24,7 +24,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpimage.h" #include "gimpdrawable.h" #include "gimpdrawableundo.h" diff --git a/app/core/gimpfilter.c b/app/core/gimpfilter.c index 6b83385516..9f2448d061 100644 --- a/app/core/gimpfilter.c +++ b/app/core/gimpfilter.c @@ -25,7 +25,7 @@ #include "core-types.h" #include "gimp.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpfilter.h" diff --git a/app/core/gimpidtable.c b/app/core/gimpidtable.c index 5cbe150068..563a08ca42 100644 --- a/app/core/gimpidtable.c +++ b/app/core/gimpidtable.c @@ -25,8 +25,8 @@ #include "core-types.h" +#include "gimp-memsize.h" #include "gimpidtable.h" -#include "gimp-utils.h" #define GIMP_ID_TABLE_START_ID 1 diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 220c5c4fef..8bfe168b4c 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -37,8 +37,8 @@ #include "gegl/gimp-babl.h" #include "gimp.h" +#include "gimp-memsize.h" #include "gimp-parasites.h" -#include "gimp-utils.h" #include "gimpcontext.h" #include "gimpdrawablestack.h" #include "gimpgrid.h" diff --git a/app/core/gimpimageundo.c b/app/core/gimpimageundo.c index e250da2023..dea3570736 100644 --- a/app/core/gimpimageundo.c +++ b/app/core/gimpimageundo.c @@ -29,7 +29,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpdrawable.h" #include "gimpgrid.h" #include "gimpimage.h" diff --git a/app/core/gimpitempropundo.c b/app/core/gimpitempropundo.c index 104bf0d1f8..61034df727 100644 --- a/app/core/gimpitempropundo.c +++ b/app/core/gimpitempropundo.c @@ -24,7 +24,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpitem.h" #include "gimpitemtree.h" #include "gimpitempropundo.h" diff --git a/app/core/gimpmaskundo.c b/app/core/gimpmaskundo.c index 4d4627b14f..3efb559e9b 100644 --- a/app/core/gimpmaskundo.c +++ b/app/core/gimpmaskundo.c @@ -24,7 +24,7 @@ #include "gegl/gimp-gegl-utils.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpchannel.h" #include "gimpmaskundo.h" diff --git a/app/core/gimpobject.c b/app/core/gimpobject.c index 7b7fd86e4a..6cfdb4dcfb 100644 --- a/app/core/gimpobject.c +++ b/app/core/gimpobject.c @@ -26,7 +26,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpmarshal.h" #include "gimpobject.h" diff --git a/app/core/gimppalette.c b/app/core/gimppalette.c index 17ed42db41..a7a2c70bf0 100644 --- a/app/core/gimppalette.c +++ b/app/core/gimppalette.c @@ -28,7 +28,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimppalette.h" #include "gimppalette-load.h" #include "gimppalette-save.h" diff --git a/app/core/gimpparasitelist.c b/app/core/gimpparasitelist.c index 563050ebad..1da08fab65 100644 --- a/app/core/gimpparasitelist.c +++ b/app/core/gimpparasitelist.c @@ -26,7 +26,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpmarshal.h" #include "gimpparasitelist.h" diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 7cd5352e90..b6ab28ba9f 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -33,7 +33,7 @@ #include "gegl/gimptilehandlerprojection.h" #include "gimp.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpimage.h" #include "gimpmarshal.h" #include "gimppickable.h" diff --git a/app/core/gimptagcache.c b/app/core/gimptagcache.c index da7488f2f4..d73762cbbc 100644 --- a/app/core/gimptagcache.c +++ b/app/core/gimptagcache.c @@ -31,7 +31,7 @@ #include "config/gimpxmlparser.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpcontext.h" #include "gimpdata.h" #include "gimplist.h" diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c index 3c6d71cf1c..319a284a02 100644 --- a/app/core/gimpviewable.c +++ b/app/core/gimpviewable.c @@ -32,7 +32,7 @@ #include "core-types.h" -#include "gimp-utils.h" +#include "gimp-memsize.h" #include "gimpcontext.h" #include "gimpmarshal.h" #include "gimptempbuf.h" diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c index fcb2ea0131..122aaeaad8 100644 --- a/app/pdb/gimppdb.c +++ b/app/pdb/gimppdb.c @@ -30,7 +30,7 @@ #include "pdb-types.h" #include "core/gimp.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "core/gimpcontext.h" #include "core/gimpmarshal.h" #include "core/gimpprogress.h" diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c index 7264809937..2ec02a4ac0 100644 --- a/app/pdb/gimpprocedure.c +++ b/app/pdb/gimpprocedure.c @@ -28,7 +28,7 @@ #include "pdb-types.h" #include "core/gimp.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "core/gimpchannel.h" #include "core/gimplayer.h" #include "core/gimpparamspecs.h" diff --git a/app/plug-in/gimpplugindef.c b/app/plug-in/gimpplugindef.c index fa2fbda0df..7ee1daab7b 100644 --- a/app/plug-in/gimpplugindef.c +++ b/app/plug-in/gimpplugindef.c @@ -24,7 +24,7 @@ #include "plug-in-types.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "gimpplugindef.h" #include "gimppluginprocedure.h" diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index f9b587d3e8..7078219de5 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -32,7 +32,7 @@ #include "config/gimpcoreconfig.h" #include "core/gimp.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "core/gimpmarshal.h" #include "pdb/gimppdb.h" diff --git a/app/plug-in/gimppluginprocedure.c b/app/plug-in/gimppluginprocedure.c index fec91efb8f..fa8574f545 100644 --- a/app/plug-in/gimppluginprocedure.c +++ b/app/plug-in/gimppluginprocedure.c @@ -31,7 +31,7 @@ #include "gegl/gimp-babl-compat.h" #include "core/gimp.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "core/gimpdrawable.h" #include "core/gimpmarshal.h" #include "core/gimpparamspecs.h" diff --git a/app/text/gimptext.c b/app/text/gimptext.c index c95b852dce..6649172a64 100644 --- a/app/text/gimptext.c +++ b/app/text/gimptext.c @@ -34,9 +34,10 @@ #include "text-types.h" +#include "core/gimp-memsize.h" +#include "core/gimp-utils.h" #include "core/gimpmarshal.h" #include "core/gimpstrokeoptions.h" -#include "core/gimp-utils.h" #include "gimptext.h" diff --git a/app/text/gimptextundo.c b/app/text/gimptextundo.c index e855ef0305..815d1d1532 100644 --- a/app/text/gimptextundo.c +++ b/app/text/gimptextundo.c @@ -26,9 +26,9 @@ #include "gegl/gimp-babl.h" +#include "core/gimp-memsize.h" #include "core/gimpitem.h" #include "core/gimpitemundo.h" -#include "core/gimp-utils.h" #include "gimptext.h" #include "gimptextlayer.h" diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c index 91728b9236..b71dd791ef 100644 --- a/app/vectors/gimpstroke.c +++ b/app/vectors/gimpstroke.c @@ -29,7 +29,7 @@ #include "vectors-types.h" -#include "core/gimp-utils.h" +#include "core/gimp-memsize.h" #include "core/gimpcoords.h" #include "core/gimpparamspecs.h" #include "core/gimp-transform-utils.h"