• 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: pointers in objective-c?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointers in objective-c?


  • Subject: Re: pointers in objective-c?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 1 Aug 2008 12:18:38 -0700


On 1 Aug '08, at 11:54 AM, Clark S. Cox III wrote:

There are ways to trick the runtime into treating an area of the stack as of it were an object, but the caviats are a list as long as my arm--it's just not worth it.

Yup. The main problem is refcounting — if there were still references to such an object at the time that its stack frame exited, the program would be hosed, because the object's storage would unavoidably be gone.


In addition, support for stack-based objects inevitably ends up requiring all sorts of other runtime support to handle situations like passing the object by value as a function parameter, returning it from a function, embedding it inside another object, and so on. That's why C ++ has tricky things like copy constructors and member initialization clauses.

—Jens_______________________________________________

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


References: 
 >pointers in objective-c? (From: "Wayne Shao" <email@hidden>)
 >Re: pointers in objective-c? (From: "Clark S. Cox III" <email@hidden>)

  • Prev by Date: Re: pointers in objective-c?
  • Next by Date: Re: pointers in objective-c?
  • Previous by thread: Re: pointers in objective-c?
  • Next by thread: Re: pointers in objective-c?
  • Index(es):
    • Date
    • Thread