Move libcds 1.6.0 from SVN
[libcds.git] / cds / user_setup / cache_line.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_USER_SETUP_CACHE_LINE_H
4 #define __CDS_USER_SETUP_CACHE_LINE_H
5
6 /** \file
7     \brief Cache-line size definition
8
9     This file defines cache-line size constant. The constant is used many \p libcds algorithm
10     to solve false-sharing problem.
11
12     The value of cache-line size must be power of two.
13     You may define your cache-line size by defining macro -DCDS_CACHE_LINE_SIZE=xx
14     (where \p xx is 2**N: 32, 64, 128,...) at compile-time or you may define your constant
15     value just editing \p cds/user_setup/cache_line.h file.
16
17     The default value is 64.
18 */
19
20 //@cond
21 namespace cds {
22 #ifndef CDS_CACHE_LINE_SIZE
23     static const size_t c_nCacheLineSize = 64;
24 #else
25     static const size_t c_nCacheLineSize = CDS_CACHE_LINE_SIZE;
26 #endif
27 }   // namespace cds
28 //@endcond
29
30 #endif // #ifndef __CDS_USER_SETUP_CACHE_LINE_H