Commit 063ef0c0 authored by Lewis Baker's avatar Lewis Baker Committed by Facebook GitHub Bot

Add missing custom-allocation routine for InlineTaskDetached

Summary:
Allocation of InlineTaskDetached coroutines now call through to the
folly_coro_async_malloc() and folly_coro_async_free() functions so that
their allocations can be correctly accounted for as coroutine allocations.

Reviewed By: yfeldblum

Differential Revision: D24574568

fbshipit-source-id: 9bece3f8e6f6d221bca021a50fe02e1eed88f07b
parent e90879cf
......@@ -242,6 +242,14 @@ inline InlineTask<void> InlineTaskPromise<void>::get_return_object() noexcept {
struct InlineTaskDetached {
class promise_type {
public:
static void* operator new(std::size_t size) {
return ::folly_coro_async_malloc(size);
}
static void operator delete(void* ptr, std::size_t size) {
::folly_coro_async_free(ptr, size);
}
InlineTaskDetached get_return_object() noexcept { return {}; }
std::experimental::suspend_never initial_suspend() noexcept { return {}; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment