Re: RFC: glocal - automatically freeing memory when it goes out of scope
- From: Chris Vine <chris cvine freeserve co uk>
- To: Colin Walters <walters verbum org>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: RFC: glocal - automatically freeing memory when it goes out of scope
- Date: Wed, 4 Apr 2012 16:20:00 +0100
On Tue, 03 Apr 2012 23:35:46 -0400
Colin Walters <walters verbum org> wrote:
> On Wed, 2011-11-16 at 21:05 +0100, Mikkel Kamstrup Erlandsen wrote:
> > Hi all,
> >
> > I have been looking at gcc's "cleanup" attribute[1] that allows one
> > to specify a callback that will be invoked when a variable goes out
> > of scope. This allows one to play with automatically freeing
> > resources.
>
> So this is frankly pretty cool - but we can't make GLib/GTK+
> dependent on GNU C.
I guess that for glib these things are matters of degree rather than
principle. glib now uses gcc's constructor and destructor attributes
since, I think, version 2.32 (I believe that is when gconstructor.h
first appeared), presumably on the grounds that, although non-standard,
they are also found in most mainstream compilers likely to be used
with glib.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]