Re: [Vala] use weak and var together

2009-01-11 Thread Jürg Billeter
On Sat, 2009-01-10 at 23:48 +0100, Hans Vercammen wrote: > Why do this manually? Don't you need to chain the dispose handlers > throughout the hierarchy to make it usable somehow? > As far as I understand the GObject dispose mechanism, it doesn't prevent > the cyclic references from not being clean

Re: [Vala] use weak and var together

2009-01-10 Thread Hans Vercammen
On Sat, 2009-01-10 at 21:12 -0500, Yu Feng wrote: > On Sat, 2009-01-10 at 23:48 +0100, Hans Vercammen wrote: > > On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: > > > On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > > > > On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: > > > > > On Sat

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 23:48 +0100, Hans Vercammen wrote: > On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: > > On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > > > On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: > > > > On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: > > > > >

Re: [Vala] use weak and var together

2009-01-10 Thread Hans Vercammen
On Sun, 2009-01-11 at 01:23 +0100, Thomas Chust wrote: > Hans Vercammen wrote: > > On Sat, 2009-01-10 at 13:16 -0800, Noah Gibbs wrote: > > [...] > >> Remember that an object can be part of more than one cycle, and you > >> have to know how many of those refs are "cyclic" refs, and how many > >> (i

Re: [Vala] use weak and var together

2009-01-10 Thread Thomas Chust
Hans Vercammen wrote: > On Sat, 2009-01-10 at 13:16 -0800, Noah Gibbs wrote: > [...] >> Remember that an object can be part of more than one cycle, and you >> have to know how many of those refs are "cyclic" refs, and how many >> (if any) aren't from cycles. That's non-local knowledge. What I'm >

Re: [Vala] use weak and var together

2009-01-10 Thread Hans Vercammen
On Sat, 2009-01-10 at 13:16 -0800, Noah Gibbs wrote: > In addition to keeping a list of pointers to the object, you'll need > to traverse them in some way to find cycles and free storage with > cycles, but not pointed to by any non-cycles. That pass should not be > done every time you break a poin

Re: [Vala] use weak and var together

2009-01-10 Thread Hans Vercammen
On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: > On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > > On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: > > > On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: > > > > On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: > > > > > On Fri,

Re: [Vala] use weak and var together

2009-01-10 Thread Noah Gibbs
ot;cyclic" refs, and how many (if any) aren't from cycles. That's non-local knowledge. What I'm saying is that it's not an easy think to calculate, and there's a reason that garbage collectors tend to be slow :-) --- On Sat, 1/10/09, Yu Feng wrote: > From:

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 19:36 +0100, Jürg Billeter wrote: > On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: > > On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > > > Right, but I'm not sure that you need to change anything in the unref > > > function to get dispose functionality working. Ca

Re: [Vala] use weak and var together

2009-01-10 Thread Jürg Billeter
On Sat, 2009-01-10 at 13:07 -0500, Yu Feng wrote: > On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > > Right, but I'm not sure that you need to change anything in the unref > > function to get dispose functionality working. Can you explain more > > specifically what you can't get working w

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 18:35 +0100, Jürg Billeter wrote: > On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: > > On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: > > > On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: > > > > On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: > > > > > O

Re: [Vala] use weak and var together

2009-01-10 Thread Jürg Billeter
On Sat, 2009-01-10 at 12:19 -0500, Yu Feng wrote: > On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: > > On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: > > > On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: > > > > On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: > > > > > Talking

Re: [Vala] use weak and var together

2009-01-10 Thread Yu Feng
On Sat, 2009-01-10 at 09:24 +0100, Jürg Billeter wrote: > On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: > > On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: > > > On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: > > > > Talking about circular references, is it possible to have a > > ci

Re: [Vala] use weak and var together

2009-01-10 Thread Jürg Billeter
On Sat, 2009-01-10 at 01:04 -0500, Yu Feng wrote: > On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: > > On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: > > > Talking about circular references, is it possible to have a > circular ref > > > breaker mechanism like the one in GTK for vala fun

Re: [Vala] use weak and var together

2009-01-09 Thread Yu Feng
Hi Jurg, Sorry for digging such an old post but I discovered something. See the end of the message. On Fri, 2008-12-12 at 08:08 +0100, Jürg Billeter wrote: > On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: > > On Thu, 2008-12-11 at 22:11 +0100, Jürg Billeter wrote: > > > On Wed, 2008-12-03 at 1

Re: [Vala] use weak and var together

2008-12-11 Thread Jürg Billeter
On Thu, 2008-12-11 at 23:56 -0500, Yu Feng wrote: > On Thu, 2008-12-11 at 22:11 +0100, Jürg Billeter wrote: > > On Wed, 2008-12-03 at 14:05 +, Frédéric Gaudy wrote: > > > I don't know if it' a bug or a feature. When I use weak and var > > > keywords, I obtain a error: > > > error: The type name

Re: [Vala] use weak and var together

2008-12-11 Thread Yu Feng
On Thu, 2008-12-11 at 22:11 +0100, Jürg Billeter wrote: > On Wed, 2008-12-03 at 14:05 +, Frédéric Gaudy wrote: > > I don't know if it' a bug or a feature. When I use weak and var > > keywords, I obtain a error: > > error: The type name `var' could not be found > > > > Code : > > weak var thre

Re: [Vala] use weak and var together

2008-12-11 Thread Jürg Billeter
On Wed, 2008-12-03 at 14:05 +, Frédéric Gaudy wrote: > I don't know if it' a bug or a feature. When I use weak and var > keywords, I obtain a error: > error: The type name `var' could not be found > > Code : > weak var thread = Thread.create( this.process_thread, true); I haven't decided yet

[Vala] use weak and var together

2008-12-03 Thread Frédéric Gaudy
Hi, I don't know if it' a bug or a feature. When I use weak and var keywords, I obtain a error: error: The type name `var' could not be found Code : weak var thread = Thread.create( this.process_thread, true); If I define the type, no problem. weak Thread thread = Thread.create( this.process_t