prefix.hpp 1000 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (C) 2009, 2016 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. #ifndef BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
  7. #define BOOST_LOCKFREE_PREFIX_HPP_INCLUDED
  8. /* this file defines the following macros:
  9. BOOST_LOCKFREE_CACHELINE_BYTES: size of a cache line
  10. BOOST_LOCKFREE_PTR_COMPRESSION: use tag/pointer compression to utilize parts
  11. of the virtual address space as tag (at least 16bit)
  12. */
  13. #if defined(__s390__) || defined(__s390x__)
  14. #define BOOST_LOCKFREE_CACHELINE_BYTES 256
  15. #elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
  16. #define BOOST_LOCKFREE_CACHELINE_BYTES 128
  17. #else
  18. #define BOOST_LOCKFREE_CACHELINE_BYTES 64
  19. #endif
  20. #include <boost/predef.h>
  21. #if BOOST_ARCH_X86_64 || defined (__aarch64__)
  22. #define BOOST_LOCKFREE_PTR_COMPRESSION 1
  23. #endif
  24. #endif /* BOOST_LOCKFREE_PREFIX_HPP_INCLUDED */