Adhust the SFO buffer size so it can contain a pointer at zero cost

This commit is contained in:
Denis Blank 2018-12-10 06:07:43 +01:00
parent b2726982ac
commit c7ef5c6f64

View File

@ -70,11 +70,17 @@ public:
/// The continuable type for the given parameters.
using continuable = continuable_base<
ContinuationWrapper<sizeof(detail::base::ready_continuation<Args...>),
void(promise), //
bool(is_ready_arg_t) const, //
std::tuple<Args...>(query_arg_t) //
>,
ContinuationWrapper<
// Size the buffer for the small functor optimization so the
// result itself fits in and guarantee that a pointer can
// fit in as well.
(sizeof(detail::base::ready_continuation<Args...>) < sizeof(void*)
? sizeof(void*)
: sizeof(detail::base::ready_continuation<Args...>)),
void(promise), //
bool(is_ready_arg_t) const, //
std::tuple<Args...>(query_arg_t) //
>,
detail::traits::identity<Args...>>;
};
/// \}