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

libcwd::alloc_ct Class Reference
[Finding (Information About) Memory Allocations]

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

#include <class_alloc.h>

Collaboration diagram for libcwd::alloc_ct:

Collaboration graph
[legend]
List of all members.

Public Member Functions

size_t size (void) const
 The allocated size in bytes.

void const * start (void) const
 A pointer to the start of the allocated memory block.

memblk_types_nt memblk_type (void) const
 A flag indicating the type of allocation.

type_info_ct const & type_info (void) const
 A reference to the type info of the pointer to the allocated memory block.

char const * description (void) const
 A pointer to a description of the allocated memory block.

timeval const & time (void) const
 The time at which this allocation was made.

location_ct const & location (void) const
 The source file location that the allocator was called from.


Protected Member Functions

 alloc_ct (void const *s, size_t sz, memblk_types_nt type, type_info_ct const &ti, struct timeval const &t, location_ct const *l)
 Construct an alloc_ct object with attributes s, sz, type, ti, t and l.

virtual ~alloc_ct ()
 Destructor.


Protected Attributes

void const * a_start
 Duplicate of (original) memblk_key_ct.

size_t a_size
 Duplicate of (original) memblk_key_ct.

memblk_types_nt a_memblk_type
 A flag which indicates the type of allocation.

type_info_ct const * type_info_ptr
 Type info of related object.

_private_::smart_ptr a_description
 A label describing this memblk.

timeval a_time
 The time at which the memory was allocated.

location_ct const * M_location
 Pointer into the location cache, with the source file, function and line number from where the allocator was called from.


Detailed Description

An object of type alloc_ct contains information about one allocated memory block.


Member Function Documentation

char const* libcwd::alloc_ct::description void   )  const [inline]
 

A pointer to a description of the allocated memory block.

This is a character string that is the result of writing the second parameter of AllocTag() to an ostrstream.

location_ct const& libcwd::alloc_ct::location void   )  const [inline]
 

The source file location that the allocator was called from.

Returns:
a const location_ct reference corresponding to the place where the allocation was done.  Class location_ct describes a source file and line number location and in which function that location resides. 
See also:
Memory Allocation Debugging And Locations

struct timeval const& libcwd::alloc_ct::time void   )  const [inline]
 

The time at which this allocation was made.

Returns:
the time at which the memory was allocated, as returned by a call to gettimeofday.

type_info_ct const& libcwd::alloc_ct::type_info void   )  const [inline]
 

A reference to the type info of the pointer to the allocated memory block.

Returns:
a reference to the static type_info_ct object that is returned by a call to type_info_of(p1).  Where p1 is the first parameter that was passed to AllocTag().

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