Re: pointers in objective-c?
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