Originally Posted by kempofighter
My biggest problem with understanding this is that I don't see how a compiler can determine whether something is read from or written to again; especially in a large scale project. I could understand the optimization happening in a small scale project with just a few files. however, many of the applications that would need to sanitize memory would be fairly complex programs. I just have a hard time getting my mind wrapped around how a compiler is going to analyze complex run-time behavior. In other words, let's say one class needs to sanitize a memory block but also provides an interface for accessing it. how does the compiler determine at compile time that it will never be accessed again without symbolically executing the source code?