![]() |
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 . |
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
.
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.