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. |