The Dynamics of Changing Dynamic Memory Allocation |
The Dynamics of Changing Dynamic Memory AllocationChanging the approach to dynamic memory allocation in a large legacy application is challenging. In order to improve the robustness of memory allocation, we fundamentally changed it. We replaced standard heap allocation with class-specific heaps. We were able to do it with almost no changes to the existing class code by overriding the new() and delete() operators, and using templates creatively to insert the changes into class hierarchies. The results have been very positive. Misuse of dynamic memory has been detected and errors caused by memory misuse have been avoided. Performance of the new memory management code has been as good or better than the previous code. Additional capabilities such as audits have been added to further increase the robustness of dynamic memory usage. Neil Harrison, Utah Valley State College John Meiners, Avaya, inc.
|