Re: Number of references to a Class Object

2011-02-14 Thread spir
On 02/14/2011 03:34 PM, Stanislav Blinov wrote: 12.02.2011 18:44, d coder пишет: Also tango (for D 1.0) implements it. Link: http://www.dsource.org/projects/tango/docs/current/tango.core.WeakRef.html Might be worth a look if you are going to implement it for D 2.0. I looked at the D1 implemen

Re: Number of references to a Class Object

2011-02-14 Thread Stanislav Blinov
12.02.2011 18:44, d coder пишет: Also tango (for D 1.0) implements it. Link: http://www.dsource.org/projects/tango/docs/current/tango.core.WeakRef.html Might be worth a look if you are going to implement it for D 2.0. I looked at the D1 implementation. It depends on GC methods weakPointerCreat

Re: Number of references to a Class Object

2011-02-14 Thread Steven Schveighoffer
On Sat, 12 Feb 2011 12:02:14 -0500, Jonathan M Davis wrote: On Saturday 12 February 2011 08:45:03 d coder wrote: > If you know roughly what to do and want to take a stab at producing a > viable patch to fix the problem, then feel free. If it's solid, it may > get in. I don't know. It doesn't

Re: Number of references to a Class Object

2011-02-13 Thread d coder
> However, it's not generally an issue, because you shouldn't normally be > keeping > references around for stuff that isn't used anymore. The garbage collector is > smart enough to deal with circular references and the like, so the biggest > cases > where you'd normally need weak references aren

Re: Number of references to a Class Object

2011-02-12 Thread Jonathan M Davis
On Saturday 12 February 2011 08:45:03 d coder wrote: > > If you know roughly what to do and want to take a stab at producing a > > viable patch to fix the problem, then feel free. If it's solid, it may > > get in. I don't know. It doesn't hurt to try though (as long as you're > > prepared for the f

Re: Number of references to a Class Object

2011-02-12 Thread d coder
> If you know roughly what to do and want to take a stab at producing a viable > patch to fix the problem, then feel free. If it's solid, it may get in. I > don't > know. It doesn't hurt to try though (as long as you're prepared for the fact > that it may not be accepted). Thanks for letting me k

Re: Number of references to a Class Object

2011-02-12 Thread bearophile
d coder: > What do you guys suggest? I suggest you to be very careful before "adapting" code from Tango, because of troublesome license issues :-( Bye, bearophile

Re: Number of references to a Class Object

2011-02-12 Thread Jonathan M Davis
On Saturday 12 February 2011 07:44:05 d coder wrote: > > Also tango (for D 1.0) implements it. > > Link: > > http://www.dsource.org/projects/tango/docs/current/tango.core.WeakRef.htm > > l > > > > Might be worth a look if you are going to implement it for D 2.0. > > I looked at the D1 implementat

Re: Number of references to a Class Object

2011-02-12 Thread d coder
> Also tango (for D 1.0) implements it. > Link: > http://www.dsource.org/projects/tango/docs/current/tango.core.WeakRef.html > > Might be worth a look if you are going to implement it for D 2.0. > I looked at the D1 implementation. It depends on GC methods weakPointerCreate and weakPointerDestroy.

Re: Number of references to a Class Object

2011-02-12 Thread Simon Buerger
On 12.02.2011 11:47, bearophile wrote: d coder: Is there a way fro the users like myself to vote up an issue on DMD Bugzilla. In this case I think voting is not so useful. I think that actually implementing weak references is better (and later they may be added to Phobos). It requires some

Re: Number of references to a Class Object

2011-02-12 Thread spir
On 02/12/2011 08:33 AM, d coder wrote: I believe what you're referring to is generally called a Weak Reference, which is a reference that the GC doesn't consider when deciding to keep an object alive, but that the GC will update if an object dies. There's a feature request at http://d.puremagic.c

Re: Number of references to a Class Object

2011-02-12 Thread bearophile
d coder: > Is there a way fro the users like myself to vote up an issue on DMD Bugzilla. In this case I think voting is not so useful. I think that actually implementing weak references is better (and later they may be added to Phobos). It requires some work and knowledge of D and its GC. rebin

Re: Number of references to a Class Object

2011-02-11 Thread d coder
> I believe what you're referring to is generally called a Weak > Reference, which is a reference that the GC doesn't consider when > deciding to keep an object alive, but that the GC will update if an > object dies. > There's a feature request at > http://d.puremagic.com/issues/show_bug.cgi?id=41

Re: Number of references to a Class Object

2011-02-11 Thread Andrew Wiley
On Sat, Feb 12, 2011 at 1:20 AM, d coder wrote: > Greetings > > I am in a situation where I need to know the number of references to a > class' object. To explain, I have an array of class objects and I > occasionally process this array. But if a particular object in this

Number of references to a Class Object

2011-02-11 Thread d coder
Greetings I am in a situation where I need to know the number of references to a class' object. To explain, I have an array of class objects and I occasionally process this array. But if a particular object in this array is not being garbage collected just because it is part of this arr