nvwa Namespace Reference

Classes

class  fast_mutex
 Class for non-reentrant fast mutexes. More...
class  fast_mutex_autolock
 An acquistion-on-initialization lock class based on fast_mutex. More...
class  class_level_lock
 Helper class for class-level locking. More...
class  class_level_lock< _Host, false >
 Partial specialization that makes null locking. More...
class  object_level_lock
 Helper class for object-level locking. More...
class  debug_new_recorder
 Recorder class to remember the call context. More...
class  debug_new_counter
 Counter class for on-exit leakage check. More...
struct  new_ptr_list_t
 Structure to store the position information where new occurs. More...
class  mem_pool_base
 Base class for memory pools. More...
class  static_mem_pool_set
 Singleton class to maintain a set of existing instantiations of static_mem_pool. More...
class  static_mem_pool
 Singleton class template to manage the allocation/deallocation of memory blocks of one specific size. More...
class  fixed_mem_pool
 Class template to manipulate a fixed-size memory pool. More...
struct  dereference
 Functor to return objects pointed by a container of pointers. More...
struct  dereference_less
 Functor to compare objects pointed by a container of pointers. More...
struct  delete_object
 Functor to delete objects pointed by a container of pointers. More...
struct  output_object
 Functor to output objects pointed by a container of pointers. More...
class  bool_array
 Class to represent a packed boolean array. More...
class  fc_queue
 Class to represent a fixed-capacity queue. More...

Typedefs

typedef double pctimer_t

Functions

int check_leaks ()
 Checks for memory leaks.
int check_mem_corruption ()
 Checks for heap corruption.
template<class _Container , class _InputIter >
_Container & set_assign_union (_Container &dest, _InputIter first, _InputIter last)
template<class _Container , class _InputIter , class _Compare >
_Container & set_assign_union (_Container &dest, _InputIter first, _InputIter last, _Compare comp)
template<class _Container , class _InputIter >
_Container & set_assign_difference (_Container &dest, _InputIter first, _InputIter last)
template<class _Container , class _InputIter , class _Compare >
_Container & set_assign_difference (_Container &dest, _InputIter first, _InputIter last, _Compare comp)
pctimer_t pctimer (void)
void swap (bool_array &lhs, bool_array &rhs) noexcept
 Exchanges the content of two bool_arrays.
template<class _Tp , class _Alloc >
void swap (fc_queue< _Tp, _Alloc > &lhs, fc_queue< _Tp, _Alloc > &rhs)
 Exchanges the elements of two queues.

Variables

bool new_autocheck_flag = true
 Flag to control whether check_leaks will be automatically called on program exit.
bool new_verbose_flag = false
 Flag to control whether verbose messages are output.
FILE * new_output_fp = stderr
 Pointer to the output stream.
const char * new_progname = _DEBUG_NEW_PROGNAME
 Pointer to the program name.
const size_t PLATFORM_MEM_ALIGNMENT = sizeof(size_t) * 2
 The platform memory alignment.

Typedef Documentation

typedef double nvwa::pctimer_t

Function Documentation

int nvwa::check_leaks (  ) 

Checks for memory leaks.

Returns:
zero if no leakage is found; the number of leaks otherwise
int nvwa::check_mem_corruption (  ) 

Checks for heap corruption.

Returns:
zero if no problem is found; the number of found memory corruptions otherwise
pctimer_t nvwa::pctimer ( void   )  [inline]
template<class _Container , class _InputIter , class _Compare >
_Container& nvwa::set_assign_difference ( _Container &  dest,
_InputIter  first,
_InputIter  last,
_Compare  comp 
) [inline]
template<class _Container , class _InputIter >
_Container& nvwa::set_assign_difference ( _Container &  dest,
_InputIter  first,
_InputIter  last 
) [inline]
template<class _Container , class _InputIter , class _Compare >
_Container& nvwa::set_assign_union ( _Container &  dest,
_InputIter  first,
_InputIter  last,
_Compare  comp 
) [inline]
template<class _Container , class _InputIter >
_Container& nvwa::set_assign_union ( _Container &  dest,
_InputIter  first,
_InputIter  last 
) [inline]
template<class _Tp , class _Alloc >
void nvwa::swap ( fc_queue< _Tp, _Alloc > &  lhs,
fc_queue< _Tp, _Alloc > &  rhs 
) [inline]

Exchanges the elements of two queues.

Parameters:
lhs the first queue to exchange
rhs the second queue to exchange
Postcondition:
If swapping the allocators does not throw, lhs will be swapped with rhs. If swapping the allocators throws with strong exception safety guarantee, this function will also provide such guarantee.
void nvwa::swap ( bool_array &  lhs,
bool_array &  rhs 
) [inline]

Exchanges the content of two bool_arrays.

Parameters:
lhs the first bool_array to exchange
rhs the second bool_array to exchange

Variable Documentation

Flag to control whether check_leaks will be automatically called on program exit.

FILE * nvwa::new_output_fp = stderr

Pointer to the output stream.

The default output is stderr, and one may change it to a user stream if needed (say, new_verbose_flag is true and there are a lot of (de)allocations).

const char * nvwa::new_progname = _DEBUG_NEW_PROGNAME

Pointer to the program name.

Its initial value is the macro _DEBUG_NEW_PROGNAME. You should try to assign the program path to it early in your application. Assigning argv[0] to it in main is one way. If you use bash or ksh (or similar), the following statement is probably what you want: `new_progname = getenv("_");'.

bool nvwa::new_verbose_flag = false

Flag to control whether verbose messages are output.

const size_t nvwa::PLATFORM_MEM_ALIGNMENT = sizeof(size_t) * 2

The platform memory alignment.

The current value works well in platforms I have tested: Windows XP, Windows 7 x64, and Mac OS X Leopard. It may be smaller than the real alignment, but must be bigger than sizeof(size_t) for it work. nvwa::debug_new_recorder uses it to detect misaligned pointer returned by `new NonPODType[size]'.

 All Classes Namespaces Files Functions Variables Typedefs Friends Defines

Generated by  doxygen 1.6.2