Re: singletons and autoreleased objects (Karan, Cem (Civ, ARL/CISD))
Re: singletons and autoreleased objects (Karan, Cem (Civ, ARL/CISD))
- Subject: Re: singletons and autoreleased objects (Karan, Cem (Civ, ARL/CISD))
- From: Scott Ribe <email@hidden>
- Date: Thu, 14 May 2009 08:49:36 -0600
- Thread-topic: singletons and autoreleased objects (Karan, Cem (Civ, ARL/CISD))
> Please ignore
> the original question.
No ;-)
It is perfectly reasonable for a handful of objects to get allocated and
never freed throughout the lifetime of a run. It is perfectly reasonable for
some such objects to be instantiated lazily rather than at startup. So it is
normal to have some false positives if you look at the whole program
execution.
A standard technique is to exercise a function, then "mark" memory, the
perform the same function and look for leaked memory. This avoids flagging
one-time-only allocations that by design don't get freed, and is what I
typically do during development. Then very late in testing I'll look at the
whole program run and try to make sure that all never-deallocated memory is
appropriate.
Maybe you already knew this, but I thought it was worth posting for the
archives...
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden