Re: RFC: glocal - automatically freeing memory when it goes out of scope
- From: Mikkel Kamstrup Erlandsen <mikkel kamstrup canonical com>
- 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: Tue, 10 Apr 2012 11:28:42 +0200
On 04/04/2012 05:35 AM, Colin Walters 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.
Totally agreed. (although cursory research seems to indicate this will
work on clang as well, I realize glib is used with many other compilers)
I could imagine using this in some gcc/Linux-specific parts of GNOME
though; care to polish up the header, and we could put it somewhere it
can be shared/reused (not sure where...libegg?)
Sure, I have some updates lying around I want to apply as well (fx.
Go-style deferred method calls), then I repost an updated version.
Cheers,
Mikkel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]