In Section 8.2.2 we noted that in a language with dynamic arrays and a value model of

Question:

In Section 8.2.2 we noted that in a language with dynamic arrays and a value model of variables, records could have fields whose size is not known at compile time. To accommodate these, we suggested using a dope vector for the record, to track the offsets of the fields. Suppose instead that we want to maintain a static offset for each field. Can we devise an alternative strategy inspired by the stack frame layout of Figure 8.7, and divide each record into a fixed-size part and a variable-size part? What problems would we need to address?

sp- Ada: -- procedure foo(size : integer) is M : array (1..size, 1..size) of long float; Variable-size M part of the frame begin Temporaries ... end foo; Local Pointer to M variables Dope vector Fixed-size part of the frame // C99: void foo (int size) { Bookkeeping double M[size] [size];

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: