3 ms·
Is there any way to work out a priori whether or not two variables alias the same memory? (I assume that aliasing pertains to memory overlap within widths the m
by possibilistic 12y ago
Is there any way to work out a priori whether or not two variables alias the same memory? (I assume that aliasing pertains to memory overlap within widths the maximum size of memory addressable by the CPU in one instruction.)
- DannyBee 12y agoAliasing is statically undecidable for all cases in any reasonable programming language. However, the general analysis you are looking for is known as "points-to analysis". It is a very large and complicated topic. Happy to try to answer anything more specific though.
- Ono-Sendai 12y agoIn a functional programming language, aliasing either doesn't matter (as accesses will be read-only for function arguments), or is easy, as the function result is not the same array as either of the arguments.