Skip to content

Commit

Permalink
Remove deprecated handler allocation hooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Oct 25, 2023
1 parent 86c6eac commit 71dafa9
Show file tree
Hide file tree
Showing 27 changed files with 41 additions and 1,477 deletions.
2 changes: 0 additions & 2 deletions asio/include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ nobase_include_HEADERS = \
asio/generic/raw_protocol.hpp \
asio/generic/seq_packet_protocol.hpp \
asio/generic/stream_protocol.hpp \
asio/handler_alloc_hook.hpp \
asio/handler_continuation_hook.hpp \
asio/high_resolution_timer.hpp \
asio.hpp \
Expand All @@ -433,7 +432,6 @@ nobase_include_HEADERS = \
asio/impl/execution_context.ipp \
asio/impl/executor.hpp \
asio/impl/executor.ipp \
asio/impl/handler_alloc_hook.ipp \
asio/impl/io_context.hpp \
asio/impl/io_context.ipp \
asio/impl/multiple_exceptions.ipp \
Expand Down
1 change: 0 additions & 1 deletion asio/include/asio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
#include "asio/generic/raw_protocol.hpp"
#include "asio/generic/seq_packet_protocol.hpp"
#include "asio/generic/stream_protocol.hpp"
#include "asio/handler_alloc_hook.hpp"
#include "asio/handler_continuation_hook.hpp"
#include "asio/high_resolution_timer.hpp"
#include "asio/io_context.hpp"
Expand Down
27 changes: 0 additions & 27 deletions asio/include/asio/compose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "asio/async_result.hpp"
#include "asio/detail/base_from_cancellation_state.hpp"
#include "asio/detail/composed_work.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
#include "asio/detail/type_traits.hpp"

Expand Down Expand Up @@ -131,32 +130,6 @@ class composed_op<Impl, Work, Handler, R(Args...)>
unsigned invocations_;
};

template <typename Impl, typename Work, typename Handler, typename Signature>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
composed_op<Impl, Work, Handler, Signature>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Impl, typename Work, typename Handler, typename Signature>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
composed_op<Impl, Work, Handler, Signature>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Impl, typename Work, typename Handler, typename Signature>
inline bool asio_handler_is_continuation(
composed_op<Impl, Work, Handler, Signature>* this_handler)
Expand Down
213 changes: 0 additions & 213 deletions asio/include/asio/detail/bind_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "asio/detail/config.hpp"
#include "asio/associator.hpp"
#include "asio/detail/handler_alloc_helpers.hpp"
#include "asio/detail/handler_cont_helpers.hpp"
#include "asio/detail/type_traits.hpp"

Expand Down Expand Up @@ -65,32 +64,6 @@ class binder0
Handler handler_;
};

template <typename Handler>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder0<Handler>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder0<Handler>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler>
inline bool asio_handler_is_continuation(
binder0<Handler>* this_handler)
Expand Down Expand Up @@ -152,32 +125,6 @@ class binder1
Arg1 arg1_;
};

template <typename Handler, typename Arg1>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder1<Handler, Arg1>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder1<Handler, Arg1>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1>
inline bool asio_handler_is_continuation(
binder1<Handler, Arg1>* this_handler)
Expand Down Expand Up @@ -246,32 +193,6 @@ class binder2
Arg2 arg2_;
};

template <typename Handler, typename Arg1, typename Arg2>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder2<Handler, Arg1, Arg2>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder2<Handler, Arg1, Arg2>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
inline bool asio_handler_is_continuation(
binder2<Handler, Arg1, Arg2>* this_handler)
Expand Down Expand Up @@ -347,32 +268,6 @@ class binder3
Arg3 arg3_;
};

template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline bool asio_handler_is_continuation(
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
Expand Down Expand Up @@ -456,34 +351,6 @@ class binder4
Arg4 arg4_;
};

template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline bool asio_handler_is_continuation(
Expand Down Expand Up @@ -575,34 +442,6 @@ class binder5
Arg5 arg5_;
};

template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline bool asio_handler_is_continuation(
Expand Down Expand Up @@ -650,32 +489,6 @@ class move_binder1
Arg1 arg1_;
};

template <typename Handler, typename Arg1>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
move_binder1<Handler, Arg1>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
move_binder1<Handler, Arg1>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1>
inline bool asio_handler_is_continuation(
move_binder1<Handler, Arg1>* this_handler)
Expand Down Expand Up @@ -716,32 +529,6 @@ class move_binder2
Arg2 arg2_;
};

template <typename Handler, typename Arg1, typename Arg2>
inline asio_handler_allocate_is_deprecated
asio_handler_allocate(std::size_t size,
move_binder2<Handler, Arg1, Arg2>* this_handler)
{
#if defined(ASIO_NO_DEPRECATED)
asio_handler_alloc_helpers::allocate(size, this_handler->handler_);
return asio_handler_allocate_is_no_longer_used();
#else // defined(ASIO_NO_DEPRECATED)
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
inline asio_handler_deallocate_is_deprecated
asio_handler_deallocate(void* pointer, std::size_t size,
move_binder2<Handler, Arg1, Arg2>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
#if defined(ASIO_NO_DEPRECATED)
return asio_handler_deallocate_is_no_longer_used();
#endif // defined(ASIO_NO_DEPRECATED)
}

template <typename Handler, typename Arg1, typename Arg2>
inline bool asio_handler_is_continuation(
move_binder2<Handler, Arg1, Arg2>* this_handler)
Expand Down
Loading

0 comments on commit 71dafa9

Please sign in to comment.