Re: [Newbie Q] Memory Management in Cocoa
Re: [Newbie Q] Memory Management in Cocoa
- Subject: Re: [Newbie Q] Memory Management in Cocoa
- From: Douglas Davidson <email@hidden>
- Date: Tue, 5 Nov 2002 15:16:50 -0800
On Tuesday, November 5, 2002, at 03:12 PM, Jonathan E. Jackel wrote:
I'd rather look at the object as shared. Creating it and retaining it
seems to me equivalent in the sense that both chunks of code -- the
one
who alloc/init'd, and the one who retained -- have precisely the same
rights and duties so far as the object in question is concerned. If
you
insist of speaking ownership, then the object has more owners at once
;)
I've always liked the dog-leash metaphor. Imagine a dog. If you want
to
walk the dog you put a leash on his collar. But the dog is very
popular.
Any number of people can "retain" the dog by adding any number of
leashes.
When each person is tired of walking the dog, he/she releases the
leash.
When the last person let's go of the last leash, the dog is "freed".
That's a striking metaphor, but I think it really doesn't go anywhere...
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.