FROM : Michael Tsai
DATE : Fri Feb 08 05:56:59 2008
On Feb 7, 2008, at 11:23 PM, John Engelhart wrote:
> Another claim I have made is that "treating everything on the stack
> as __strong is not the right thing, it is only going to mask the
> problem." One could argue that the choice of treating everything
> on the stack as __strong is proof of how often the compiler is
> getting this automagic promotion wrong, or otherwise dropping the
> __strong qualification during some code transformation. My
> hypothesis is that if write barriers were being generated
> correctly, there would be no need to treat the stack as special,
> other than the fact of "how much" of the stack to be considered
> live relative to the top frame.
Treating everything on the stack as __strong makes things simpler for
the programmer; you don't have to worry about what the compiler is or
isn't checking for you. Secondly, as you noted above, it's relatively
expensive to turn assignments into function calls. It would be a
waste of time to do this for variables within short-lived stack frames.
> Despite the (sometimes foaming at the mouth) assertions that the GC
> rules are "easy", what is transpiring is reasonable people are
> having differences of opinion regarding the use of GC allocated
> memory.
Perhaps we can agree that the rules for objects, the most common
case, are easy.
--Michael
DATE : Fri Feb 08 05:56:59 2008
On Feb 7, 2008, at 11:23 PM, John Engelhart wrote:
> Another claim I have made is that "treating everything on the stack
> as __strong is not the right thing, it is only going to mask the
> problem." One could argue that the choice of treating everything
> on the stack as __strong is proof of how often the compiler is
> getting this automagic promotion wrong, or otherwise dropping the
> __strong qualification during some code transformation. My
> hypothesis is that if write barriers were being generated
> correctly, there would be no need to treat the stack as special,
> other than the fact of "how much" of the stack to be considered
> live relative to the top frame.
Treating everything on the stack as __strong makes things simpler for
the programmer; you don't have to worry about what the compiler is or
isn't checking for you. Secondly, as you noted above, it's relatively
expensive to turn assignments into function calls. It would be a
waste of time to do this for variables within short-lived stack frames.
> Despite the (sometimes foaming at the mouth) assertions that the GC
> rules are "easy", what is transpiring is reasonable people are
> having differences of opinion regarding the use of GC allocated
> memory.
Perhaps we can agree that the rules for objects, the most common
case, are easy.
--Michael






Cocoa mail archive

