Skip to content

Commit

Permalink
add [[clang::coro_await_elidable]] to NothrowAwaitable and `TryAw…
Browse files Browse the repository at this point in the history
…aitable`

Summary: [[clang::coro_await_elidable]] is an attribute to help us elide more coroutine heap allocations. See the diff where we enabled it. D58956574

Reviewed By: skrueger

Differential Revision: D67299322

fbshipit-source-id: 2321765fd8818d8025e4e5c4a2f83a52544c1b37
  • Loading branch information
yuxuanchen1997 authored and facebook-github-bot committed Jan 3, 2025
1 parent 5029050 commit aea6096
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions folly/coro/ViaIfAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ class CommutativeWrapperAwaitable {
};

template <typename T>
class TryAwaitable : public CommutativeWrapperAwaitable<TryAwaitable, T> {
class [[FOLLY_ATTR_CLANG_CORO_AWAIT_ELIDABLE]] TryAwaitable
: public CommutativeWrapperAwaitable<TryAwaitable, T> {
public:
using CommutativeWrapperAwaitable<TryAwaitable, T>::
CommutativeWrapperAwaitable;
Expand Down Expand Up @@ -680,7 +681,7 @@ using semi_await_try_result_t =
namespace detail {

template <typename T>
class NothrowAwaitable
class [[FOLLY_ATTR_CLANG_CORO_AWAIT_ELIDABLE]] NothrowAwaitable
: public CommutativeWrapperAwaitable<NothrowAwaitable, T> {
public:
using CommutativeWrapperAwaitable<NothrowAwaitable, T>::
Expand Down

0 comments on commit aea6096

Please # to comment.