Main Page   Reference Manual   Namespace List   Compound List   Namespace Members   Compound Members   File Members  

De-Allocation Pointer Validation
Collaboration diagram for De-Allocation Pointer Validation:
A pointer passed to a de-allocation (or re-allocation) function is checked to be valid; it should be previously returned by a corresponding (re-)allocation function and not have been de-allocated before.  Table 1. shows the relationships between allocation and de-allocation functions.
Table 1. De-allocation functions and their corresponding allocation functions
De- or re-allocation function Allocation function
delete new
delete [] new []
free() malloc(), calloc() or realloc()
realloc() malloc(), calloc() or realloc()
The application will terminate with an informative message and a core dump when a pointer is de-allocated that was not previously allocated with the corresponding allocation function.Note: When libcwd was configured with –disable-magic then the check whether or not the de-allocated memory block was allocated with the corresponding allocation function is not performed when the memory block is invisible.  The reason for this is that invisible memory blocks are simply not stored in the internal data structure: No information is known about them.
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.