Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
- Subject: Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
- From: Nat! <email@hidden>
- Date: Thu, 1 Jan 2004 16:39:07 +0100
Am 01.01.2004 um 08:29 schrieb Glen Low:
As someone else pointed out, you can't use alloca to allocate memory
that is expected to last outside of the function call. Rather, you
could create a C++ template with the right amount of memory within
scope, or use a std::vector of these.
These C++ objects have no longer lifetime than alloca.
That's the deal with stack based data, it vanishises when the stack
unwinds. As I hinted using C++ would enable to call your dealloc
method, but you don't need to free anyway. Putting complex objects on
the stack that retain each other is IMO _even_ _more_ foolhardy.
That does mean in order to cache what is necessary for a method call,
you have to keep the IMP as well as the SEL?
Yes.
Ciao
Nat!
I act professionally, when I get paid for it. - Unknown
_______________________________________________
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.