mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
b58693b8e8
Before this commit, the execution logic of RecursiveCoroutine used an underlying std::stack allocated on the heap to hold all the coroutine_handles. It also manually managed passing return values from callees to callers. This commit drops this unnecessary auxiliary stack. When a RecursiveCoroutine co_awaits another one, the handle of the awaiter is injected into the awaitee, so that when the awaitee is done it can directly execute the remaining part of the awaiter as a continuation.
18 lines
262 B
C
18 lines
262 B
C
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include <utility>
|
|
|
|
#if defined(DISABLE_RECURSIVE_COROUTINES)
|
|
|
|
#include "RecursiveCoroutine-fallback.h"
|
|
|
|
#else
|
|
|
|
#include "RecursiveCoroutine-coroutine.h"
|
|
|
|
#endif
|