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

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

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

#include <class_alloc.h>

Public Member Functions

size_t size () const
 The allocated size in bytes.
 
void const * start () const
 A pointer to the start of the allocated memory block.
 
memblk_types_nt memblk_type () const
 A flag indicating the type of allocation.
 
type_info_ct const & type_info () const
 A reference to the type info of the pointer to the allocated memory block. More...
 
char const * description () const
 A pointer to a description of the allocated memory block. More...
 
struct timeval const & time () const
 The time at which this allocation was made. More...
 
location_ct const & location () const
 The source file location that the allocator was called from. More...
 

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.
 
struct 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

◆ description()

char const* libcwd::alloc_ct::description ( ) 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.

References a_description.

◆ location()

location_ct const& libcwd::alloc_ct::location ( ) 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

References M_location.

◆ time()

struct timeval const& libcwd::alloc_ct::time ( ) 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.

References a_time.

◆ type_info()

type_info_ct const& libcwd::alloc_ct::type_info ( ) 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().

References type_info_ptr.

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