On Jul 30, 6:28 am, George Neuner <gneun...@comcast.net> wrote:> On Mon, 27 Jul 2009 11:18:56 -0700 (PDT), Christoffer Lernv> <le...@dragonascendant.com> wrote:>> In the case of an OO language with dynamic dispatch, then if I'm not>> mistaken it's not really possible to tell what happens to any of the>> arguments of a method invocation (including the object itself) at>> compile time.>>> It's only post-fact (when returning from the current scope) one is in>> a position to determine is the object will outlive the current scope>> or not.>> Even though the control path is not determined until run time, it is> still statically specified (even in Lisp where you can add/subtract> methods at run time). Although you don't know which control path will> be taken, you still know that (depending on what the language allows)> only actual OO objects, local structures or pointers to them can> possibly escape. The analysis considers the set of potential escapees> passed to the static method call. The actual types involved don't> matter, the analysis is only concerned with names.

We create the objects NSString path and NSData rtfData, but both of
those are argment for methods that has implementations that are
determined at runtime, which means we cannot determine if the extent
of these objects need to outlive the current scope.

In fact, I cannot think of any non-trivial object usage where we can
assert that escape is impossible, since even

SomeObject *someObject = [[SomeObject alloc] init];

could possibly already cause "someObject" to be registered to an
object outside the scope of the current function.