schema used. However, any implementation supports common interface for the type of data structure.
To implement any lock-free data structure, two things are needed:
- - atomic operation library conforming with C++11 memory model. The <b>libcds</b> has such feature, see cds::cxx11_atomics namespace for
+ - atomic operation library conforming with C++11 memory model. The <b>libcds</b> has such feature, see cds::cxx11_atomic namespace for
details and compiler-specific information.
- safe memory reclamation (SMR) or garbage collecting (GC) algorithm. The <b>libcds</b> has an implementation of several
well-known SMR algos, see below.
// CDS_VERIFY: Debug - assert(_expr); Release - _expr
#ifdef CDS_DEBUG
# define CDS_VERIFY( _expr ) assert( _expr )
-# define CDS_DEBUG_DO( _expr ) _expr
+# define CDS_DEBUG_ONLY( _expr ) _expr
#else
# define CDS_VERIFY( _expr ) _expr
-# define CDS_DEBUG_DO( _expr )
+# define CDS_DEBUG_ONLY( _expr )
#endif
#ifdef CDS_STRICT
// Compiler-specific defines
#include <cds/compiler/defs.h>
-// New C++11 features
-#include <cds/details/cxx11_features.h>
#define CDS_NOEXCEPT CDS_NOEXCEPT_SUPPORT
#define CDS_NOEXCEPT_( expr ) CDS_NOEXCEPT_SUPPORT_( expr )
-#ifndef CDS_NOEXCEPT_DEFAULTED
- // Some compilers do not allow noexcept specification in defaulted function
- // For example, GCC 4.6.x raise following error:
- // void foo() noexcept = default
- // error: function \91foo\92 defaulted on its first declaration must not have an exception-specification
- // For such compiler empty CDS_NOEXCEPT_DEFAULTED must be defined
-# define CDS_NOEXCEPT_DEFAULTED CDS_NOEXCEPT
-# define CDS_NOEXCEPT_DEFAULTED_(expr) CDS_NOEXCEPT_( expr )
-#endif
-
-#if defined(CDS_CXX11_VARIADIC_TEMPLATE_SUPPORT) && defined(CDS_MOVE_SEMANTICS_SUPPORT)
-# define CDS_EMPLACE_SUPPORT
-#endif
#ifdef CDS_CXX11_INLINE_NAMESPACE_SUPPORT
# define CDS_CXX11_INLINE_NAMESPACE inline
Common things
**************************************************************************/
-#include <cds/details/numtraits.h>
-
namespace cds {
/// Base of all exceptions in the library
{
if ( !bCond ) {
char buf[4096];
-# if CDS_COMPILER == CDS_COMPILER_MSVC || CDS_COMPILER == CDS_COMPILER_INTEL
+# if CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CS_OSI_WINDOWS)
_snprintf_s( buf, sizeof(buf)/sizeof(buf[0]), _TRUNCATE, pszMsg, pszFile, nLine );
# else
snprintf( buf, sizeof(buf)/sizeof(buf[0]), pszMsg, pszFile, nLine );