Question: In Ada 83, pointers (access variables) can point only to objects in the heap. Ada 95 allows a new kind of pointer, the access all

In Ada 83, pointers (access variables) can point only to objects in the heap. Ada 95 allows a new kind of pointer, the access all type, to point to other objects as well, provided that those objects have been declared to be aliased:

type int_ptr is access all Integer;

foo : aliased Integer;

ip : int_ptr;

...

ip := foo'Access;

The ‚Access attribute is roughly equivalent to C’s “address of” (&) operator. How would you implement access all types and aliased objects? How would your implementation interact with automatic garbage collection (assuming it exists) for objects in the heap?

Step by Step Solution

3.33 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The purpose of an access all pointer is to refer to an object that is not dynamically allocated and ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Language Pragmatics Questions!