Allocate subobjects on the heap for debugging

As discussed in "Allocate storage only if you must" on page 73, there is no storage allocation overhead if an object can be local to a function. Many objects have very localized scope and do not need to be allocated on the heap.

TIP When you do early development, it is sometimes useful to allocate subobjects on the heap to avoid some recompilation when their declarations change. Because the subobject isn't inline, the layout of the owner doesn't change when the subobject does. If you do this, make sure you take it out before you release your code.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker