#ifndef __CDS_GC_DETAILS_HP_ALLOC_H
#define __CDS_GC_DETAILS_HP_ALLOC_H
-#include <cds/cxx11_atomic.h>
+#include <cds/algo/atomic.h>
#include <cds/details/allocator.h>
#include <cds/gc/details/hp_type.h>
}
/// Allocates hazard pointer
- atomic_hazard_ptr& alloc() CDS_NOEXCEPT
+ atomic_hazard_ptr& alloc()
{
assert( m_nTop > 0 );
--m_nTop;
assert( m_nTop < capacity() );
hp.clear();
++m_nTop;
- CDS_COMPILER_RW_BARRIER ; // ???
}
/// Allocates hazard pointers array
Returns initialized object \p arr
*/
template <size_t Count>
- void alloc( hp_array<Count>& arr ) CDS_NOEXCEPT
+ void alloc( hp_array<Count>& arr )
{
assert( m_nTop >= Count );
m_nTop -= Count;
template <size_t Count>
void free( hp_array<Count> const& arr ) CDS_NOEXCEPT
{
+ CDS_UNUSED( arr );
+
assert( m_nTop + Count <= capacity());
for ( size_t i = m_nTop; i < m_nTop + Count; ++i )
- m_arrHazardPtr[ i ].clear();
+ m_arrHazardPtr[i].clear();
m_nTop += Count;
}
void make_free() CDS_NOEXCEPT
{
for ( size_t i = 0; i < capacity(); ++i )
- m_arrHazardPtr[ i ].clear();
+ m_arrHazardPtr[i].clear();
m_nTop = capacity();
}