Odd array allocation in GtkAboutDialog.xs
- From: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
- To: gtk-perl-list gnome org
- Subject: Odd array allocation in GtkAboutDialog.xs
- Date: Sun, 25 Oct 2009 15:16:55 +0100
Hi,
I've found a strange memory allocation in GtkAboutDialog.xs and I don't understand why. Take a look at the following macro:
#define SETTER(outof)ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ \
ÂÂÂ {ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ \
ÂÂÂ ÂÂÂ gint num = items - 1;ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ \
ÂÂÂ ÂÂÂ (outof) = g_new0 (gchar *, num + 30);ÂÂÂ ÂÂÂ \
ÂÂÂ ÂÂÂ for (i = 0; i < num; i++)ÂÂÂ ÂÂÂ ÂÂÂ \
ÂÂÂ ÂÂÂ ÂÂÂ (outof)[i] = SvGChar (ST (1 + i));ÂÂÂ \
ÂÂÂ }
It allocates and array with 30 extra elements. I don't understand why such extreme generosity.
--
Emmanuel Rodriguez
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]