We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1c3308 commit 6271495Copy full SHA for 6271495
1 file changed
include/stdexec/__detail/__connect_awaitable.hpp
@@ -74,7 +74,11 @@ namespace STDEXEC
74
struct __synthetic_coro_frame
75
{
76
void (*__resume_)(void*) noexcept;
77
- void (*__destroy_)(void*) noexcept = nullptr;
+ // a coroutine frame is usually headed by two function pointers, resume and destroy
78
+ // in our use, below, we never invoke destroy so there's no need to actually store
79
+ // it; instead, leave some padding at the end of the struct so we can use its last
80
+ // byte to store a bool indicating whether or not we ever started the operation
81
+ std::byte __padding_[sizeof(void*) - 1]{};
82
};
83
84
static constexpr std::ptrdiff_t __promise_offset = sizeof(__synthetic_coro_frame);
0 commit comments