reference to delegates and garbage collection

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 15 09:45:37 PDT 2014


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 variable
...
call collect
...
ret # from main


collect:
...
push esi
...
pop esi
ret


Note the instance address is preserved in a register even if it's 
not needed. And this happen only if you read a field.


More information about the Digitalmars-d-learn mailing list