cpp03_zone_decl.hpp.erb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // MessagePack for C++ memory pool
  3. //
  4. // Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef MSGPACK_V1_CPP03_ZONE_DECL_HPP
  11. #define MSGPACK_V1_CPP03_ZONE_DECL_HPP
  12. #include <cstdlib>
  13. #include <memory>
  14. #include <vector>
  15. #include "msgpack/versioning.hpp"
  16. #ifndef MSGPACK_ZONE_CHUNK_SIZE
  17. #define MSGPACK_ZONE_CHUNK_SIZE 8192
  18. #endif
  19. #ifndef MSGPACK_ZONE_ALIGN
  20. #define MSGPACK_ZONE_ALIGN sizeof(void*)
  21. #endif
  22. #if defined(_MSC_VER)
  23. #define MSGPACK_ZONE_ALIGNOF(type) __alignof(type)
  24. #else
  25. #define MSGPACK_ZONE_ALIGNOF(type) __alignof__(type)
  26. #endif
  27. // For a compiler that doesn't support __alignof__:
  28. // #define MSGPACK_ZONE_ALIGNOF(type) MSGPACK_ZONE_ALIGN
  29. <% GENERATION_LIMIT = 15 %>
  30. namespace msgpack {
  31. /// @cond
  32. MSGPACK_API_VERSION_NAMESPACE(v1) {
  33. /// @endcond
  34. class zone;
  35. std::size_t aligned_size(
  36. std::size_t size,
  37. std::size_t align = MSGPACK_ZONE_ALIGN);
  38. /// @cond
  39. } // MSGPACK_API_VERSION_NAMESPACE(v1)
  40. /// @endcond
  41. } // namespace msgpack
  42. #endif // MSGPACK_V1_CPP03_ZONE_DECL_HPP