Escape Analysis

In programming language compiler optimization theory, escape analysis is a method for determining the dynamic scope of pointers. It is related to pointer analysis and shape analysis.

When a variable (or an object) is allocated in a subroutine, a pointer to the variable can escape to other threads of execution, or to calling subroutines. If an implementation uses tail call optimization (usually required for functional languages), objects may also be seen as escaping to called subroutines. If a language supports first-class continuations (as do Scheme and Standard ML of New Jersey), portions of the call stack may also escape.

If a subroutine allocates an object and returns a pointer to it, the object can be accessed from undetermined places in the program — the pointer has "escaped". Pointers can also escape if they are stored in global variables or other data structures that, in turn, escape the current procedure.

Escape analysis determines all the places where a pointer can be stored and whether the lifetime of the pointer can be proven to be restricted only to the current procedure and/or thread.

Read more about Escape Analysis:  Optimizations, Practical Considerations, Example (Java), Examples (Scheme)

Famous quotes containing the words escape and/or analysis:

    While they stand at home at the door he is dead already,
    The only son is dead.

    But the mother needs to be better,
    She with thin form presently drest in black,
    By day her meals untouch’d, then at night fitfully sleeping, often waking,
    In the midnight waking, weeping, longing with one deep longing,
    O that she might withdraw unnoticed, silent from life escape and
    withdraw,
    To follow, to seek, to be with her dear dead son.
    Walt Whitman (1819–1892)

    The spider-mind acquires a faculty of memory, and, with it, a singular skill of analysis and synthesis, taking apart and putting together in different relations the meshes of its trap. Man had in the beginning no power of analysis or synthesis approaching that of the spider, or even of the honey-bee; but he had acute sensibility to the higher forces.
    Henry Brooks Adams (1838–1918)