Compile time garbage collection

Compile time garbage collection for the declarative language Mercury, by Nancy Mazur. From the abstract:

"The compiler determines the lifetime of the variables that are created during the execution of the program, and thus also the memory that will be associated with these variables. Whenever the compiler can guarantee that a variable, or more precisely, parts of the memory resources that this variable points to at run-time, will never ever be accessed beyond a certain program instruction, then the compiler can add instructions to deallocate these resources at that particular instruction without compromising the correctness of the resulting code. If the program instruction is followed by a series of instructions that require the allocation of new memory cells, then the compiler can replace the sequence of deallocation and allocation instructions, by instructions updating the garbage cells, hence reusing these cells."

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Region Inference

This approach is similar to region inference for very small regions. Skimming this PhD thesis the only mention to regions is a small note in the conclusion saying about other approaches and mentioning that CTGC has yet to be merged with regions. It's interesting to see if both approaches can be used to improve each other. After I read the thesis I'll probably have more pointers.