]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/asio/impl/handler_alloc_hook.ipp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / impl / handler_alloc_hook.ipp
CommitLineData
b32b8144
FG
1//
2// impl/handler_alloc_hook.ipp
3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4//
f67539c2 5// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
b32b8144
FG
6//
7// Distributed under the Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9//
10
11#ifndef BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
12#define BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19#include <boost/asio/detail/thread_context.hpp>
20#include <boost/asio/detail/thread_info_base.hpp>
21#include <boost/asio/handler_alloc_hook.hpp>
22
23#include <boost/asio/detail/push_options.hpp>
24
25namespace boost {
26namespace asio {
27
20effc67
TL
28asio_handler_allocate_is_deprecated
29asio_handler_allocate(std::size_t size, ...)
b32b8144 30{
20effc67
TL
31#if defined(BOOST_ASIO_NO_DEPRECATED)
32 (void)size;
33 return asio_handler_allocate_is_no_longer_used();
34#elif !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
b32b8144
FG
35 return detail::thread_info_base::allocate(
36 detail::thread_context::thread_call_stack::top(), size);
37#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
38 return ::operator new(size);
39#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
40}
41
20effc67
TL
42asio_handler_deallocate_is_deprecated
43asio_handler_deallocate(void* pointer, std::size_t size, ...)
b32b8144 44{
20effc67
TL
45#if defined(BOOST_ASIO_NO_DEPRECATED)
46 (void)pointer;
47 (void)size;
48 return asio_handler_deallocate_is_no_longer_used();
49#elif !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
b32b8144
FG
50 detail::thread_info_base::deallocate(
51 detail::thread_context::thread_call_stack::top(), pointer, size);
52#else // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
53 (void)size;
54 ::operator delete(pointer);
55#endif // !defined(BOOST_ASIO_DISABLE_SMALL_BLOCK_RECYCLING)
56}
57
58} // namespace asio
59} // namespace boost
60
61#include <boost/asio/detail/pop_options.hpp>
62
63#endif // BOOST_ASIO_IMPL_HANDLER_ALLOC_HOOK_IPP