Re: reference to delegates and garbage collection

2014-07-15 Thread Kagamin via Digitalmars-d-learn
Since you access a field through `a` instance, this is usually done by loading the instance address into some register and reading from a location at a certain offset from that register mov esi, [ebp-4] # the instance address mov eax, [esi+8] # first field ... mov [ebp-4], 0 # clear stack

reference to delegates and garbage collection

2014-07-14 Thread AnFive via Digitalmars-d-learn
Hello everybody. I am new to D, and I am trying to familiarize with all the new (to me) features. I have a question about a strange behavior I cannot understand. (In case it matters, I am using gdc 2.065 for Windows, but the same happens with dmd). Example code : class A { void

Re: reference to delegates and garbage collection

2014-07-14 Thread Adam D. Ruppe via Digitalmars-d-learn
I'm just guessing, but it looks to me that the delegate's pointer might be on the stack there and isn't overwritten when the one function returns, so the gc still thinks there might be an active pointer to it.