set(CMAKE_BUILD_TYPE Debug CACHE STRING "Default build type to Debug" FORCE)
endif()
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pedantic -fno-strict-aliasing")
if(CMAKE_TARGET_ARCHITECTURE STREQUAL "x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcx16")
endif()
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0.0")
+ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0.0")
# gcc 4.8 - 6: disable noise -Wunused-local-typedefs
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
endif()
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_COMPILER_CLANG_DEFS_H
#define cds_likely( expr ) __builtin_expect( !!( expr ), 1 )
#define cds_unlikely( expr ) __builtin_expect( !!( expr ), 0 )
-// double-width CAS support
-#if CDS_BUILD_BITS == 64
-# ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
-# define CDS_DCAS_SUPPORT
-# endif
-#else
-# ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
-# define CDS_DCAS_SUPPORT
+// double-width CAS support - only for libc++
+#ifdef _LIBCPP_VERSION
+# if CDS_BUILD_BITS == 64
+# ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+# define CDS_DCAS_SUPPORT
+# endif
+# else
+# ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+# define CDS_DCAS_SUPPORT
+# endif
# endif
#endif
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_COMPILER_GCC_DEFS_H
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
typedef internal_bucket_type_ base_class;
public:
using base_class::base_class;
- using base_class::node_type;
+ using typename base_class::node_type;
using base_class::alloc_node;
using base_class::insert_node;
using base_class::node_to_value;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
typedef internal_bucket_type_ base_class;
public:
using base_class::base_class;
- using base_class::node_type;
+ using typename base_class::node_type;
using base_class::alloc_node;
using base_class::insert_node;
using base_class::node_to_value;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
m_guard = nullptr;
return g;
}
+
+ dhp::details::guard_data*& guard_ref()
+ {
+ return m_guard;
+ }
//@endcond
private:
/// Move-assignment from \p Guard
guarded_ptr& operator=( Guard&& g ) CDS_NOEXCEPT
{
- std::swap( m_guard, g.m_guard );
+ std::swap( m_guard, g.guard_ref() );
return *this;
}
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
m_guard = nullptr;
return g;
}
+
+ hp::details::hp_guard*& guard_ref()
+ {
+ return m_guard;
+ }
//@endcond
private:
/// Move-assignment from \p Guard
guarded_ptr& operator=( Guard&& g ) CDS_NOEXCEPT
{
- std::swap( m_pGuard, g.m_guard );
+ std::swap( m_pGuard, g.guard_ref() );
return *this;
}
value_ptr operator ->() const
{
- return m_Guard.get<value_type>();
+ return m_Guard.template get<value_type>();
}
value_ref operator *() const
{
assert( m_Guard.get_native() != nullptr );
- return *m_Guard.get<value_type>();
+ return *m_Guard.template get<value_type>();
}
/// Pre-increment
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSUNIT_SET_TEST_INTRUSIVE_SKIPLIST_RCU_H
#define CDSUNIT_SET_TEST_INTRUSIVE_SKIPLIST_RCU_H
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::hash_int hash_int;
+ //typedef typename TestFixture::hash_int hash_int;
struct traits : public ci::skip_list::traits
{
static const size_t nSize = 20;
typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
typedef typename List::value_type list_value_type;
struct key_val {
int key;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
// Postcondition: list is empty
static const size_t nSize = 20;
- typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
- typedef typename List::value_type list_value_type;
typedef typename List::guarded_ptr guarded_ptr;
struct key_val {
static const size_t nSize = 20;
typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
typedef typename List::value_type list_value_type;
struct key_val {
int key;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSUNIT_LIST_TEST_KV_LIST_HP_H
// Postcondition: list is empty
static const size_t nSize = 20;
- typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
- typedef typename List::value_type list_value_type;
typedef typename List::guarded_ptr guarded_ptr;
struct key_val {
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSUNIT_LIST_TEST_KV_LIST_NOGC_H
// Postcondition: list is empty
static const size_t nSize = 20;
- typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
typedef typename List::value_type list_value_type;
struct key_val {
// Postcondition: list is empty
static const size_t nSize = 20;
- typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
- typedef typename List::value_type list_value_type;
struct key_val {
int key;
// Postcondition: list is empty
static const size_t nSize = 20;
- typedef typename List::key_type list_key_type;
- typedef typename List::mapped_type list_mapped_type;
- typedef typename List::value_type list_value_type;
struct key_val {
int key;
int val;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
EXPECT_TRUE( m.empty());
EXPECT_CONTAINER_SIZE( m, 0 );
- typedef typename Map::value_type map_pair;
size_t const kkSize = base_class::kSize;
std::vector<key_type> arrKeys;
typedef typename Map::value_type map_pair;
typedef typename Map::iterator iterator;
- typedef typename Map::const_iterator const_iterator;
size_t const kkSize = kSize;
std::vector<key_type> arrKeys;
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSUNIT_MAP_TEST_MAP_RCU_H
ASSERT_TRUE( m.empty());
ASSERT_CONTAINER_SIZE( m, 0 );
- typedef typename Map::value_type map_pair;
size_t const kkSize = base_class::kSize;
std::vector<key_type> arrKeys;
EXPECT_TRUE( m.empty());
EXPECT_CONTAINER_SIZE( m, 0 );
- typedef typename Map::value_type map_pair;
size_t const kkSize = base_class::kSize;
std::vector<key_type> arrKeys;
test_atomic_integral_volatile<unsigned long long>();
}
+#if CDS_COMPILER != CDS_COMPILER_CLANG || defined(_LIBCPP_VERSION)
TEST_F( cxx11_atomic_class, atomic_pointer_void )
{
do_test_atomic_pointer_void<false>();
{
do_test_atomic_pointer_void<true>();
}
+#endif
TEST_F( cxx11_atomic_class, atomic_pointer_char )
{
test_atomic_integral_volatile<unsigned long long>();
}
+#if CDS_COMPILER != CDS_COMPILER_CLANG || defined(_LIBCPP_VERSION)
TEST_F( cxx11_atomic_func, atomic_pointer_void )
{
do_test_atomic_pointer_void<false>();
{
do_test_atomic_pointer_void<true>();
}
+#endif
TEST_F( cxx11_atomic_func, atomic_pointer_char )
{
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_ordered_set_hp.h"
void SetUp()
{
- struct set_traits: public cc::skip_list::traits
- {
- typedef cmp compare;
- };
typedef cc::SkipListSet< gc_type, int_item > set_type;
cds::gc::dhp::GarbageCollector::Construct( 16, set_type::c_nHazardPtrCount );
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_ordered_set_hp.h"
void SetUp()
{
- struct set_traits: public cc::skip_list::traits
- {
- typedef cmp compare;
- };
typedef cc::SkipListSet< gc_type, int_item > set_type;
// +1 - for guarded_ptr
for ( auto it = s.begin(); it != s.end(); ++it ) {
int key = it->key();
ASSERT_TRUE( s.erase_at( it ));
- ASSERT_TRUE( &*it != nullptr );
EXPECT_EQ( it->key(), key );
ASSERT_FALSE( s.erase_at( it ) );
}
base_class::test_< Set::c_isSorted>( s, data );
- typedef typename Set::value_type value_type;
size_t const nSetSize = base_class::kSize;
// clear