|
2 | 2 | * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
|
3 | 3 | */
|
4 | 4 |
|
| 5 | +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") |
| 6 | + |
5 | 7 | package kotlinx.coroutines.internal
|
6 | 8 |
|
7 | 9 | import kotlinx.coroutines.*
|
8 | 10 | import kotlin.coroutines.*
|
9 | 11 | import kotlin.coroutines.intrinsics.*
|
| 12 | +import kotlin.internal.InlineOnly |
10 | 13 |
|
| 14 | +@InlineOnly |
11 | 15 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
12 | 16 | internal actual inline fun DisposableHandle.asShareable(): DisposableHandle = this
|
13 | 17 |
|
| 18 | +@InlineOnly |
14 | 19 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
15 | 20 | internal actual inline fun CoroutineDispatcher.asShareable(): CoroutineDispatcher = this
|
16 | 21 |
|
| 22 | +@InlineOnly |
17 | 23 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
18 | 24 | internal actual inline fun <T> Continuation<T>.asShareable() : Continuation<T> = this
|
19 | 25 |
|
| 26 | +@InlineOnly |
20 | 27 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
21 | 28 | internal actual inline fun <T> Continuation<T>.asLocal() : Continuation<T> = this
|
22 | 29 |
|
| 30 | +@InlineOnly |
23 | 31 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
24 | 32 | internal actual inline fun <T> Continuation<T>.asLocalOrNull() : Continuation<T>? = this
|
25 | 33 |
|
| 34 | +@InlineOnly |
26 | 35 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
27 | 36 | internal actual inline fun <T> Continuation<T>.useLocal() : Continuation<T> = this
|
28 | 37 |
|
| 38 | +@InlineOnly |
29 | 39 | @Suppress("NOTHING_TO_INLINE") // Should be NOP
|
30 | 40 | internal actual inline fun <T> Continuation<T>.shareableInterceptedResumeCancellableWith(result: Result<T>) {
|
31 | 41 | intercepted().resumeCancellableWith(result)
|
32 | 42 | }
|
33 | 43 |
|
| 44 | +@InlineOnly |
34 | 45 | @Suppress("NOTHING_TO_INLINE") // Save an entry on call stack
|
35 | 46 | internal actual inline fun <T> CancellableContinuationImpl<T>.shareableResume(delegate: Continuation<T>, useMode: Int) =
|
36 | 47 | resumeImpl(delegate, useMode)
|
37 | 48 |
|
| 49 | +@InlineOnly |
38 | 50 | @Suppress("NOTHING_TO_INLINE") // Save an entry on call stack
|
39 | 51 | internal actual inline fun isReuseSupportedInPlatform() = true
|
40 | 52 |
|
| 53 | +@InlineOnly |
41 | 54 | internal actual inline fun <T> ArrayList<T>.addOrUpdate(element: T, update: (ArrayList<T>) -> Unit) {
|
42 | 55 | add(element)
|
43 | 56 | }
|
44 | 57 |
|
| 58 | +@InlineOnly |
45 | 59 | internal actual inline fun <T> ArrayList<T>.addOrUpdate(index: Int, element: T, update: (ArrayList<T>) -> Unit) {
|
46 | 60 | add(index, element)
|
47 | 61 | }
|
|
0 commit comments