comparison DEPENDENCIES/generic/include/boost/lockfree/detail/prefix.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 // Copyright (C) 2009 Tim Blechmann
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See
4 // accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
8 #define BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
9
10 /* this file defines the following macros:
11 BOOST_LOCKFREE_CACHELINE_BYTES: size of a cache line
12 BOOST_LOCKFREE_PTR_COMPRESSION: use tag/pointer compression to utilize parts
13 of the virtual address space as tag (at least 16bit)
14 BOOST_LOCKFREE_DCAS_ALIGNMENT: symbol used for aligning structs at cache line
15 boundaries
16 */
17
18 #define BOOST_LOCKFREE_CACHELINE_BYTES 64
19
20 #ifdef _MSC_VER
21
22 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT __declspec(align(BOOST_LOCKFREE_CACHELINE_BYTES))
23
24 #if defined(_M_IX86)
25 #define BOOST_LOCKFREE_DCAS_ALIGNMENT
26 #elif defined(_M_X64) || defined(_M_IA64)
27 #define BOOST_LOCKFREE_PTR_COMPRESSION 1
28 #define BOOST_LOCKFREE_DCAS_ALIGNMENT __declspec(align(16))
29 #endif
30
31 #endif /* _MSC_VER */
32
33 #ifdef __GNUC__
34
35 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT __attribute__((aligned(BOOST_LOCKFREE_CACHELINE_BYTES)))
36
37 #if defined(__i386__) || defined(__ppc__)
38 #define BOOST_LOCKFREE_DCAS_ALIGNMENT
39 #elif defined(__x86_64__)
40 #define BOOST_LOCKFREE_PTR_COMPRESSION 1
41 #define BOOST_LOCKFREE_DCAS_ALIGNMENT __attribute__((aligned(16)))
42 #elif defined(__alpha__)
43 // LATER: alpha may benefit from pointer compression. but what is the maximum size of the address space?
44 #define BOOST_LOCKFREE_DCAS_ALIGNMENT
45 #endif
46 #endif /* __GNUC__ */
47
48 #ifndef BOOST_LOCKFREE_DCAS_ALIGNMENT
49 #define BOOST_LOCKFREE_DCAS_ALIGNMENT /*BOOST_LOCKFREE_DCAS_ALIGNMENT*/
50 #endif
51
52 #ifndef BOOST_LOCKFREE_CACHELINE_ALIGNMENT
53 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT /*BOOST_LOCKFREE_CACHELINE_ALIGNMENT*/
54 #endif
55
56 #endif /* BOOST_LOCKFREE_PREFIX_HPP_INCLUDED */