Fixed iteration set stress test under 32bit architecture
authorkhizmax <libcds.dev@gmail.com>
Sun, 21 Aug 2016 06:17:33 +0000 (09:17 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 21 Aug 2016 06:17:33 +0000 (09:17 +0300)
Added missing header
Docfix

cds/details/defs.h
cds/gc/details/hp_alloc.h
projects/Win/vc14/cds.sln
test/stress/set/iteration/set_iteration.h

index 30bbf4c..1727dfb 100644 (file)
 
    The test projects depends on the following static library from \p boost:
    - \p boost.thread
-   - \p boost.date_time
+   - \p boost.system
 
    \par Windows build
 
index d6d42a5..f0c562b 100644 (file)
@@ -34,6 +34,7 @@
 #include <cds/algo/atomic.h>
 #include <cds/details/allocator.h>
 #include <cds/gc/details/hp_type.h>
+#include <string.h> // memset
 
 //@cond
 namespace cds {
index deb3006..8fbe313 100644 (file)
@@ -227,6 +227,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-map-insfind-int", "s
        EndProjectSection\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stress-set-iteration", "stress-set-iteration.vcxproj", "{31952FA8-A303-4A0B-94C4-ABA5A8A6DBCE}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {A34CED07-A442-4FA1-81C4-F8B9CD3C832B} = {A34CED07-A442-4FA1-81C4-F8B9CD3C832B}\r
+               {408FE9BC-44F0-4E6A-89FA-D6F952584239} = {408FE9BC-44F0-4E6A-89FA-D6F952584239}\r
+       EndProjectSection\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
index 5cb8d1e..7757b87 100644 (file)
@@ -409,7 +409,11 @@ namespace set {
                     typename Set::iterator itEnd;
                     itEnd = rSet.end();
                     for ( it = rSet.begin(); it != itEnd; ++it ) {
+#if CDS_BUILD_BITS == 64
                         it->val.hash = CityHash64( it->key.c_str(), it->key.length());
+#else
+                        it->val.hash = std::hash<std::string>()( it->key );
+#endif
                         ++m_nVisitCount;
                     }
                 }
@@ -453,7 +457,11 @@ namespace set {
                     ++m_nPassCount;
                     typename Set::rcu_lock l;
                     for ( auto it = rSet.begin(); it != rSet.end(); ++it ) {
+#if CDS_BUILD_BITS == 64
                         it->val.hash = CityHash64( it->key.c_str(), it->key.length() );
+#else
+                        it->val.hash = std::hash<std::string>()(it->key);
+#endif
                         ++m_nVisitCount;
                     }
                 }