Why does my test fail with an error indicating memory exhausted?
When a pointer is used that points to a structure outside of the area that VectorCAST has allocated, this causes a behavior that is compiler dependent and thus unpredictable because the heap allocation method does not specify what happens if memory before or after the allocated memory is changed. Your case was memory exhausted, other possibilities are corruption of data, or a crash.
It is very important to check for...
With VectorCAST/Ada it is not usually necessary to inspect the code. If there is a problem, Ada’s strong typing will cause a run time error and corrective measures can be taken. With C/C++ that is not the case and the code must be inspected.