7 #ifndef _FREE_LIST_CLASS_HEADER_
8 #define _FREE_LIST_CLASS_HEADER_
13 #ifdef A_UTILS_TAGGED_POINTER_AVALIABLE
21 template <
class T,
class DataType>
22 class A_UTILS_CAS_ALIGNMENT free_list
25 typedef tagged_ptr<T> tTaggedNodePtr;
28 tTaggedNodePtr m_pFree;
46 for (
tUInt nNode = 0; nNode < nReserve; ++nNode)
49 pTmp->m_pNext = m_pFree;
59 T* pTmp = m_pFree.GetPtr();
62 T* pNext = pTmp->m_pNext.GetPtr();
77 tTaggedNodePtr pOldTos;
92 T* pNewTos = pOldTos->m_pNext.GetPtr();
94 if (m_pFree.CompareAndSwap(pOldTos, pNewTos))
96 return pOldTos.GetPtr();
107 tVoid AddFreeNode(T* pNode)
115 pNode->m_pNext.Set(pOld.GetPtr());
117 while (!m_pFree.CompareAndSwap(pOld, pNode));
121 free_list(
const free_list& oOther);
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent type).
void tVoid
The tVoid is always the definition for the void (non-type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
#define tTrue
Value for tBool.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
datamodel::DataType DataType
Reuse of datamodel datatype class - ddl::dd::datamodel::DataType.