HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_MemoryCounterTotal Class Reference

#include <UT_MemoryCounter.h>

+ Inheritance diagram for UT_MemoryCounterTotal:

Public Member Functions

 UT_MemoryCounterTotal ()
 
virtual ~UT_MemoryCounterTotal ()
 
virtual void reset ()
 
virtual bool countShared (size_t size, exint refcount, const void *p)
 
virtual size_t getCount () const
 This returns the current count of memory used. More...
 
- Public Member Functions inherited from UT_MemoryCounter
 UT_MemoryCounter ()
 
virtual ~UT_MemoryCounter ()
 
void countUnshared (size_t size)
 
bool mustCountShared () const
 
bool mustCountUnshared () const
 

Additional Inherited Members

- Protected Member Functions inherited from UT_MemoryCounter
 UT_MemoryCounter (const bool countshared, const bool countunshared)
 

Detailed Description

This subclass counts shared memory under the assumption that all memory is being counted, so on a block of memory referenced refcount times, countShared() will be called refcount times. To avoid double-counting of this shared memory, countShared() divides by refcount.

Definition at line 310 of file UT_MemoryCounter.h.

Constructor & Destructor Documentation

UT_MemoryCounterTotal::UT_MemoryCounterTotal ( )
inline

Definition at line 313 of file UT_MemoryCounter.h.

virtual UT_MemoryCounterTotal::~UT_MemoryCounterTotal ( )
inlinevirtual

Definition at line 317 of file UT_MemoryCounter.h.

Member Function Documentation

virtual bool UT_MemoryCounterTotal::countShared ( size_t  size,
exint  refcount,
const void p 
)
inlinevirtual

This counts shared memory according to the requirements of the use case. This implementation avoids double-counting of referenced memory by dividing size by the reference count.

Reimplemented from UT_MemoryCounter.

Definition at line 330 of file UT_MemoryCounter.h.

virtual size_t UT_MemoryCounterTotal::getCount ( ) const
inlinevirtual

This returns the current count of memory used.

Reimplemented from UT_MemoryCounter.

Definition at line 338 of file UT_MemoryCounter.h.

virtual void UT_MemoryCounterTotal::reset ( void  )
inlinevirtual

This resets any data structures used for counting to their freshly-constructed state.

Reimplemented from UT_MemoryCounter.

Definition at line 321 of file UT_MemoryCounter.h.


The documentation for this class was generated from the following file: