JX Application Framework
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
JMMRecord Class Reference

#include <JMMRecord.h>

Inheritance diagram for JMMRecord:
[legend]

Public Types

enum  Type {
  kManager = -2 ,
  kLibrary = -1 ,
  kApp = 0 ,
  kBucket1 = 1 ,
  kBucket2 = 2 ,
  kBucket3 = 3
}
 

Public Member Functions

 JMMRecord ()
 
 JMMRecord (const JUInt32 id, const void *address, const size_t size, const JUtf8Byte *file, const JUInt32 lineNumber, const int type, const bool array)
 
JUInt32 GetID () const
 
const void * GetAddress () const
 
size_t GetSize () const
 
const JUtf8ByteGetNewFile () const
 
JUInt32 GetNewLine () const
 
const JUtf8ByteGetDeleteFile () const
 
JUInt32 GetDeleteLine () const
 
void SetDeleteLocation (const JUtf8Byte *deleteFile, const JSize deleteLine, const bool arrayDelete)
 
bool IsDeleted () const
 
bool IsArrayNew () const
 
bool IsArrayDelete () const
 
const JUtf8ByteNewTypeName () const
 
const JUtf8ByteDeleteTypeName () const
 
bool IsManagerMemory () const
 
bool IsLibraryMemory () const
 
bool IsAppMemory () const
 
int GetMemoryBucket () const
 
void StreamForDebug (std::ostream &output) const
 
void PrintLayout () const
 

Static Public Member Functions

static const JUtf8ByteTypeName (const unsigned isArray)
 

Detailed Description

JMMRecord objects record statistics on a block allocated through
JMemoryManager.

For maximum space efficiency JMMRecord does NOT have a virtual destructor.
It isn't intended to be a base class, so if you do subclass it be careful.

03/12/05 (Dustin Laurence)

In fact, JMMRecord is just Plain Old Data (POD) except that it has
constructors.  The offsetof operator can only be called on POD, so
JMMRecordData defines a POD type that PrintLayout can call offsetof on
without generating stupid compiler warnings.  This requires using assignment
instead of initializers in the JMMRecord constructor, but this should not
even incur a performance penalty because JMMRecordData contains only
intrinsic POD types.

Shutting up the compiler is the *ONLY* reason JMMRecordData exists, so
don't use it for anything else.





Base code generated by Codemill v0.1.0

Member Enumeration Documentation

◆ Type

Enumerator
kManager 
kLibrary 
kApp 
kBucket1 
kBucket2 
kBucket3 

Constructor & Destructor Documentation

◆ JMMRecord() [1/2]

JMMRecord::JMMRecord ( )

◆ JMMRecord() [2/2]

JMMRecord::JMMRecord ( const JUInt32  id,
const void *  address,
const size_t  size,
const JUtf8Byte file,
const JUInt32  lineNumber,
const int  type,
const bool  array 
)

Member Function Documentation

◆ DeleteTypeName()

const JUtf8Byte * JMMRecord::DeleteTypeName ( ) const

◆ GetAddress()

const void * JMMRecord::GetAddress ( ) const
inline

◆ GetDeleteFile()

const JUtf8Byte * JMMRecord::GetDeleteFile ( ) const
inline

◆ GetDeleteLine()

JUInt32 JMMRecord::GetDeleteLine ( ) const
inline

◆ GetID()

JUInt32 JMMRecord::GetID ( ) const
inline

◆ GetMemoryBucket()

int JMMRecord::GetMemoryBucket ( ) const
inline

◆ GetNewFile()

const JUtf8Byte * JMMRecord::GetNewFile ( ) const
inline

◆ GetNewLine()

JUInt32 JMMRecord::GetNewLine ( ) const
inline

◆ GetSize()

size_t JMMRecord::GetSize ( ) const
inline

◆ IsAppMemory()

bool JMMRecord::IsAppMemory ( ) const
inline

◆ IsArrayDelete()

bool JMMRecord::IsArrayDelete ( ) const
inline

◆ IsArrayNew()

bool JMMRecord::IsArrayNew ( ) const
inline

◆ IsDeleted()

bool JMMRecord::IsDeleted ( ) const
inline

◆ IsLibraryMemory()

bool JMMRecord::IsLibraryMemory ( ) const
inline

◆ IsManagerMemory()

bool JMMRecord::IsManagerMemory ( ) const
inline

◆ NewTypeName()

const JUtf8Byte * JMMRecord::NewTypeName ( ) const

◆ PrintLayout()

void JMMRecord::PrintLayout ( ) const

Prints the layout of a JMMRecord in memory. Useful for optimizing the memory manager's memory usage on a particular architecture, which can be important considering how many records can potentially be stored.

This method ought to be static but isn't to accomodate certain compilers implement sizeof() and/or offsetof(). It isn't very hard to use the default constructor to create a throwaway object anyway.

03/12/05 (Dustin)

PrintLayout now prints the layout of JMMRecordData so picky compilers won't complain about applying offsetof to a non-POD type. It would be legal (though stupid) according to the standard for JMMRecord to not be identical to JMMRecordData, but that doesn't matter because the JMMRecordData part of JMMRecord would surely be bitwise identical to JMMRecordData anyway and therefore optimizing the packing of JMMRecordData amounts to optimizing of JMMRecord.

◆ SetDeleteLocation()

void JMMRecord::SetDeleteLocation ( const JUtf8Byte deleteFile,
const JSize  deleteLine,
const bool  arrayDelete 
)

◆ StreamForDebug()

void JMMRecord::StreamForDebug ( std::ostream &  output) const

Dual function is jx_memory_debugger Record constructor.

◆ TypeName()

const JUtf8Byte * JMMRecord::TypeName ( const unsigned  isArray)
static

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