• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [ANN] Mulle kybernetiK - Optimizing Objective-C code - Articles #3.1 + #9 online
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: People who develop with MySQL and/or other GPL based code
  • Next by Date: NSTimer is firing twice...
  • Previous by thread: Re: People who develop with MySQL and/or other GPL based code
  • Next by thread: NSTimer is firing twice...
  • Index(es):
    • Date
    • Thread