Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / external_libraries / boost-lockfree / boost / lockfree / detail / prefix.hpp
blob6ed9446cb0abeb71020e869233cf3efd655434dc
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)
7 #ifndef BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
8 #define BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
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
18 #define BOOST_LOCKFREE_CACHELINE_BYTES 64
20 #ifdef _MSC_VER
22 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT __declspec(align(BOOST_LOCKFREE_CACHELINE_BYTES))
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
31 #endif /* _MSC_VER */
33 #ifdef __GNUC__
35 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT __attribute__((aligned(BOOST_LOCKFREE_CACHELINE_BYTES)))
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__ */
48 #ifndef BOOST_LOCKFREE_DCAS_ALIGNMENT
49 #define BOOST_LOCKFREE_DCAS_ALIGNMENT /*BOOST_LOCKFREE_DCAS_ALIGNMENT*/
50 #endif
52 #ifndef BOOST_LOCKFREE_CACHELINE_ALIGNMENT
53 #define BOOST_LOCKFREE_CACHELINE_ALIGNMENT /*BOOST_LOCKFREE_CACHELINE_ALIGNMENT*/
54 #endif
56 #endif /* BOOST_LOCKFREE_PREFIX_HPP_INCLUDED */