HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry Class Reference

#include <UT_PageArray.h>

Public Types

typedef PageTableEntry ThisType
 
typedef UT_FixedVector
< NotVoidType,
theSafeTupleSize
Tuple
 

Public Member Functions

SYS_FORCE_INLINE bool isConstant () const
 This is always valid to call. More...
 
SYS_FORCE_INLINE bool isConstantZero () const
 This is only valid to call if the type doesn't fit inline. More...
 
SYS_FORCE_INLINE bool isConstantAndZeroSafe () const
 
SYS_FORCE_INLINE bool isRefd (exint tuplebytes) const
 
SYS_FORCE_INLINE bool isShared () const
 
SYS_FORCE_INLINE void incRef ()
 
SYS_FORCE_INLINE void decRef ()
 
SYS_FORCE_INLINE exint getRefCount () const
 
SYS_FORCE_INLINE void alloc (UT_PageOff nelements, exint tuplesize=TSIZE)
 
void realloc (UT_PageOff sizetocopy, UT_PageOff newpagecapacity, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE bool decRefIffShared (exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE NotVoidTypegetFirstPtr ()
 Returns the data pointer, if not a constant page. More...
 
SYS_FORCE_INLINE const
NotVoidType
getFirstPtr () const
 Returns the data pointer, if not a constant page. More...
 
SYS_FORCE_INLINE voidgetFirstPtrVoid ()
 Returns the data pointer, if not a constant page. More...
 
SYS_FORCE_INLINE const voidgetFirstPtrVoid () const
 Returns the data pointer, if not a constant page. More...
 
SYS_FORCE_INLINE voidgetFirstPtrVoidUnsafe ()
 
SYS_FORCE_INLINE const voidgetFirstPtrVoidUnsafe () const
 
SYS_FORCE_INLINE NotVoidTypegetInlinePtr (exint tuplesize)
 Returns the data pointer, if an inline constant page. More...
 
SYS_FORCE_INLINE const
NotVoidType
getInlinePtr (exint tuplesize) const
 Returns the data pointer, if an inline constant page. More...
 
SYS_FORCE_INLINE NotVoidTypegetMaskedPtr ()
 
SYS_FORCE_INLINE const
NotVoidType
getMaskedPtr () const
 
SYS_FORCE_INLINE voidgetMaskedPtrVoid ()
 
SYS_FORCE_INLINE const voidgetMaskedPtrVoid () const
 
SYS_FORCE_INLINE void initZero ()
 
SYS_FORCE_INLINE void setConstantBit ()
 
void tryCompressPage (UT_PageOff pagesize, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE int64 getMemoryUsage (exint tuplebytes) const
 
template<typename DEST_DATA_T >
SYS_FORCE_INLINE const
UT_PageArray< DEST_DATA_T,
TSIZE, TABLEHARDENED,
PAGESHARDENED, THEPAGEBITS,
IDX_T >::PageTableEntry
castType () const
 
template<typename DEST_DATA_T >
SYS_FORCE_INLINE UT_PageArray
< DEST_DATA_T, TSIZE,
TABLEHARDENED, PAGESHARDENED,
THEPAGEBITS, IDX_T >
::PageTableEntry
castType ()
 
SYS_FORCE_INLINE bool operator== (const ThisType &that) const
 NOTE: This just does a shallow comparison. More...
 
SYS_FORCE_INLINE bool operator!= (const ThisType &that) const
 NOTE: This just does a shallow comparison. More...
 

Static Public Member Functions

static SYS_FORCE_INLINE bool typeFitsInline (exint tuplesize=TSIZE)
 This is only valid to call when DATA_T is non-void. More...
 

Static Public Attributes

static const uintptr_t theConstantPageBit = 1
 

Detailed Description

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
class UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry

Definition at line 2192 of file UT_PageArray.h.

Member Typedef Documentation

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
typedef PageTableEntry UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::ThisType

Definition at line 2195 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
typedef UT_FixedVector<NotVoidType,theSafeTupleSize> UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::Tuple

Definition at line 2196 of file UT_PageArray.h.

Member Function Documentation

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::alloc ( UT_PageOff  nelements,
exint  tuplesize = TSIZE 
)
inline

Definition at line 2281 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
template<typename DEST_DATA_T >
SYS_FORCE_INLINE const UT_PageArray<DEST_DATA_T,TSIZE,TABLEHARDENED,PAGESHARDENED,THEPAGEBITS,IDX_T>::PageTableEntry* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::castType ( ) const
inline

Definition at line 2537 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
template<typename DEST_DATA_T >
SYS_FORCE_INLINE UT_PageArray<DEST_DATA_T,TSIZE,TABLEHARDENED,PAGESHARDENED,THEPAGEBITS,IDX_T>::PageTableEntry* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::castType ( )
inline

Definition at line 2545 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::decRef ( )
inline

NOTE: This should only be called when there's an actual allocated page to decRef, i.e. !isConstant() || (!typeFitsInline(tuplesize) && !isConstantZero()).

Definition at line 2258 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::decRefIffShared ( exint  tuplesize = TSIZE)
inline

Atomically decrement the reference count iff the page is shared. See the description of decRefIffSharedPage() above for why this function exists.

Definition at line 2337 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtr ( )
inline

Returns the data pointer, if not a constant page.

Definition at line 2350 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtr ( ) const
inline

Returns the data pointer, if not a constant page.

Definition at line 2360 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtrVoid ( )
inline

Returns the data pointer, if not a constant page.

Definition at line 2370 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtrVoid ( ) const
inline

Returns the data pointer, if not a constant page.

Definition at line 2379 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtrVoidUnsafe ( )
inline

Returns the data pointer, or whatever's in its place with bit 0 set to 1 if it's something constant. If it's constant, it might not be a flagged pointer.

Definition at line 2390 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getFirstPtrVoidUnsafe ( ) const
inline

Returns the data pointer, or whatever's in its place with bit 0 set to 1 if it's something constant. If it's constant, it might not be a flagged pointer.

Definition at line 2399 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getInlinePtr ( exint  tuplesize)
inline

Returns the data pointer, if an inline constant page.

Definition at line 2406 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getInlinePtr ( exint  tuplesize) const
inline

Returns the data pointer, if an inline constant page.

Definition at line 2415 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getMaskedPtr ( )
inline

Returns the data pointer, if a non-inline constant page. Returns nullptr for a zero constant page.

Definition at line 2425 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const NotVoidType* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getMaskedPtr ( ) const
inline

Returns the data pointer, if a non-inline constant page. Returns nullptr for a zero constant page.

Definition at line 2436 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getMaskedPtrVoid ( )
inline

Returns the data pointer, if a non-inline constant page. Returns nullptr for a zero constant page.

Definition at line 2447 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE const void* UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getMaskedPtrVoid ( ) const
inline

Returns the data pointer, if a non-inline constant page. Returns nullptr for a zero constant page.

Definition at line 2457 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE int64 UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getMemoryUsage ( exint  tuplebytes) const
inline

NOTE: This always excludes sizeof(*this), and is only valid for non-small pages, (okay if constant).

Definition at line 2525 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE exint UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::getRefCount ( ) const
inline

NOTE: This should only be called when there's an actual allocated page, i.e. !isConstant() || (!typeFitsInline(tuplesize) && !isConstantZero()).

Definition at line 2275 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::incRef ( )
inline

NOTE: This should only be called when there's an actual allocated page to decRef, i.e. !isConstant() || (!typeFitsInline(tuplesize) && !isConstantZero()).

Definition at line 2251 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::initZero ( )
inline

Initializes a page to constant zero, assuming that it hasn't been initialized yet.

Definition at line 2467 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::isConstant ( ) const
inline

This is always valid to call.

Definition at line 2200 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::isConstantAndZeroSafe ( ) const
inline

This is always valid to call, and will return true iff this is either inline and all zero or using the constant zero optimization.

Definition at line 2212 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::isConstantZero ( ) const
inline

This is only valid to call if the type doesn't fit inline.

Definition at line 2205 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::isRefd ( exint  tuplebytes) const
inline

This is always valid to call, but be aware that the parameter is the number of bytes in a tuple, not the number of components in a tuple.

Definition at line 2229 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::isShared ( ) const
inline

NOTE: This should only be called when there's an actual allocated page, i.e. !isConstant() || (!typeFitsInline(tuplesize) && !isConstantZero()).

Definition at line 2243 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::operator!= ( const ThisType that) const
inline

NOTE: This just does a shallow comparison.

Definition at line 2559 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::operator== ( const ThisType that) const
inline

NOTE: This just does a shallow comparison.

Definition at line 2553 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::realloc ( UT_PageOff  sizetocopy,
UT_PageOff  newpagecapacity,
exint  tuplesize = TSIZE 
)
inline

Definition at line 2292 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
SYS_FORCE_INLINE void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::setConstantBit ( )
inline

Definition at line 2474 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
void UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::tryCompressPage ( UT_PageOff  pagesize,
exint  tuplesize = TSIZE 
)
inline

Definition at line 2479 of file UT_PageArray.h.

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
static SYS_FORCE_INLINE bool UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::typeFitsInline ( exint  tuplesize = TSIZE)
inlinestatic

This is only valid to call when DATA_T is non-void.

Definition at line 2218 of file UT_PageArray.h.

Member Data Documentation

template<typename DATA_T, exint TSIZE = 1, bool TABLEHARDENED = false, bool PAGESHARDENED = false, exint THEPAGEBITS = 10, typename IDX_T = exint>
const uintptr_t UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry::theConstantPageBit = 1
static

Definition at line 2197 of file UT_PageArray.h.


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