Re: [patch] [bug 461795] reduce some small allocations



On 03/12/2007, Christian Persch <chpe gnome org> wrote:
> attached patch from bug http://bugzilla.gnome.org/show_bug.cgi?id=461795
> removes some small allocations, and makes other use GSlice.

Briefly wondering about the sizes of some of the buffers - you're
allocating 32 bytes for lots of different things, both stuff that's
just an int and stuff that's "some text" + an int. Do the int-only
ones need to be 32 bytes, and conversely is 32 bytes big enough for
the "some text" cases? It's picky, but this patch is addressing some
pretty small memory changes. AFAIK, provided GINT_MAX stays at 2^32
(true on 64-bit?), then we only need 9 characters max, so it should be
ok, but this is an area where g_strdup_printf would always do the
right thing regardless of what happens in the future.

Tom Parker


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]