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

Finding (Information About) Memory Allocations
[Memory Allocation Debug Support]

Collaboration diagram for Finding (Information About) Memory Allocations:

Classes

class  libcwd::alloc_ct
 An object of type alloc_ct contains information about one allocated memory block. More...

Functions

alloc_ct const * libcwd::find_alloc (void const *ptr)
 Find information about a memory allocation.

Given a pointer, which points to the start of or inside an allocated memory block, it is possible to find information about this memory block using the libcwd function find_alloc.


Function Documentation

alloc_ct const * libcwd::find_alloc ( void const *  ptr  ) 

Find information about a memory allocation.

Given a pointer, which points to the start of or inside an allocated memory block, it is possible to find information about this memory block using the libcwd function find_alloc.

Returns:
a const pointer to an object of class alloc_ct.
See also:
test_delete()
Example:

 char* buf = new char [40];
 AllocTag(buf, "A buffer");
 libcwd::alloc_ct const* alloc = libcwd::find_alloc(&buf[10]);
 std::cout << '"' << alloc->description() << "\" is " << alloc->size() << " bytes.\n";

gives as output,

 "A buffer" is 40 bytes.

Copyright © 2001 - 2004 Carlo Wood.  All rights reserved.