/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
/// Lock-free free list
/** @ingroup cds_intrusive_freelist
- Free list is a helper class intended for reusing objects instead of freeing them completely;
+ Free list is a helper class intended for reusing objects instead of freeing them completely;
this avoids the overhead of \p malloc(), and also avoids its worst-case behavior of taking an operating system lock.
So, the free list can be considered as a specialized allocator for objects of some type.
node()
: m_freeListRefs( 0 )
- , m_freeListNext( nullptr )
- {}
+ {
+ m_freeListNext.store( nullptr, atomics::memory_order_release );
+ }
//@endcond
};
*/
~FreeList()
{
- assert( empty() );
+ assert( empty());
}
/// Puts \p pNode to the free list