KT-31741: stdlib: DeepRecursiveFunction (#3398)

Introduces experimental coroutines-based framework to execute deeply recursive functions that utilities the heap and thus avoid StackOverflowError.
This commit is contained in:
Roman Elizarov
2020-05-27 10:06:00 +03:00
committed by GitHub
parent 9fa1614903
commit 46b426ef77
7 changed files with 400 additions and 0 deletions
@@ -50,6 +50,12 @@ public actual inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedO
completion: Continuation<T>
): Any? = (this as Function2<R, Continuation<T>, Any?>).invoke(receiver, completion)
@InlineOnly
internal actual inline fun <R, P, T> (suspend R.(P) -> T).startCoroutineUninterceptedOrReturn(
receiver: R,
param: P,
completion: Continuation<T>
): Any? = (this as Function3<R, P, Continuation<T>, Any?>).invoke(receiver, param, completion)
// JVM declarations