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

#include <UT_MemoryCounter.h>

+ Inheritance diagram for UT_MemoryCounterTotal:

Public Member Functions

 UT_MemoryCounterTotal ()
 
 ~UT_MemoryCounterTotal () override
 
void reset () override
 
bool countShared (size_t size, exint refcount, const void *p) override
 
size_t getCount () const override
 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.

UT_MemoryCounterTotal::~UT_MemoryCounterTotal ( )
inlineoverride

Definition at line 317 of file UT_MemoryCounter.h.

Member Function Documentation

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

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.

size_t UT_MemoryCounterTotal::getCount ( ) const
inlineoverridevirtual

This returns the current count of memory used.

Reimplemented from UT_MemoryCounter.

Definition at line 338 of file UT_MemoryCounter.h.

void UT_MemoryCounterTotal::reset ( void  )
inlineoverridevirtual

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: