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
@@ -45,6 +45,12 @@ public actual inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedO
completion: Continuation<T>
): Any? = this.asDynamic()(receiver, completion, false)
@InlineOnly
internal actual inline fun <R, P, T> (suspend R.(P) -> T).startCoroutineUninterceptedOrReturn(
receiver: R,
param: P,
completion: Continuation<T>
): Any? = this.asDynamic()(receiver, param, completion, false)
/**
* Creates unintercepted coroutine without receiver and with result type [T].