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

Memory Allocation Debug Support: Introduction
Collaboration diagram for Memory Allocation Debug Support: Introduction:
Unless –disable-alloc was specified during configuration then the following memory allocation and de-allocation debugging features are provided by libcwd:
  1. Checking if a pointer that is passed to a memory de-allocation function is valid; and if this pointer was previously returned by a corresponding allocation function.
  2. Finding the start, size, place of allocation in the source code and allocator type of an allocated memory block when given a pointer which points inside of it (see Finding (Information About) Memory Allocations).
  3. Providing means to add type info and a description to the Allocated memory Overview (using AllocTag()).
  4. Listing an overview of allocated memory to a Debug Object.
  5. Boundary checks of allocated blocks, by means of magic numbers (see also --enable-magic (CWDEBUG_MAGIC)).
Unfortunately it is impossible to support feature 3. in C++ without putting hooks in your code: A missing AllocTag() will only have effect on the Allocated memory Overview, showing <unknown type> instead of the type and a description of the allocated object.
Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.