FROM : Jens Alfke
DATE : Fri Aug 01 21:18:38 2008
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_removed>)
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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
DATE : Fri Aug 01 21:18:38 2008
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_removed>)
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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Wayne Shao | Aug 1, 20:43 | |
| Ken Thomases | Aug 1, 20:47 | |
| Clark S. Cox III | Aug 1, 20:54 | |
| Glenn English | Aug 1, 21:10 | |
| Jens Alfke | Aug 1, 21:18 | |
| Clark S. Cox III | Aug 1, 21:24 | |
| Arthur Coleman | Aug 1, 21:38 | |
| Clark Cox | Aug 1, 22:01 | |
| Giulio Cesare Sola… | Aug 1, 22:07 | |
| Clark S. Cox III | Aug 1, 22:15 | |
| Glenn English | Aug 1, 22:20 | |
| Michael Ash | Aug 1, 22:47 | |
| Sherm Pendley | Aug 1, 23:07 | |
| Daniel Staal | Aug 2, 00:27 | |
| Negm-Awad Amin | Aug 2, 09:05 | |
| Negm-Awad Amin | Aug 2, 09:09 | |
| mm w | Aug 2, 18:50 | |
| mm w | Aug 2, 20:19 | |
| Keary Suska | Aug 2, 22:53 | |
| Negm-Awad Amin | Aug 4, 08:31 |






Cocoa mail archive

