X hits on this document

183 views

0 shares

0 downloads

0 comments

33 / 62

33

Array Memory Allocation

Local lifetime, bound at elaboration time:

Array’s shape is not known at compile time, and exists only as locally needed.

Array is allocated in subroutine’s stack frame and divided into fixed-size and variable-sized parts.

main() { var_ptr = new int[size]; }

Arbitrary lifetime, bound at elaboration time:

Array is just references to objects.

Java does not allocate space; just makes a reference to either new or existing objects.

var_ptr = new int[size];

Document info
Document views183
Page views183
Page last viewedSun Dec 11 06:31:30 UTC 2016
Pages62
Paragraphs993
Words3163

Comments