Dynamic error detection

Dynamic error detection, or discipline, is the programmatic detection of errors in either the heap code itself, or calls to the heap indirectly through operators new and delete.

The heap model has several varieties of discipline built into it:

Bad address deletion Detection of addresses that do not correspond to allocated blocks in the heap. A subset of this is double deletion detection. Therefore, these two anomalies are detected by the same class in an
either-or fashion.
Double deletion detection Detection of two deletions of the same block. This detection is complicated by the fact that the heap allocates blocks to the same address once that address is free. The tool tracks old blocks that have been deleted. When a delete is of the wrong type or is unmatched by a corresponding new, it is an error.
Non-unique allocate return values According to the The Annotated C++ Reference Manual (by Ellis and Stroustrup), operator new must return unique values (until such blocks are deleted). The toll checks this by verifying new allocations against live blocks in the existing block map.
Heap corruption Detected by calling TMemoryHeap::Check at each allocation
and deletion.


[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