Contract in CloseableReferenceCounter_Debug.withRef
This commit is contained in:
parent
3302c67fa6
commit
4b63563cbd
@ -129,6 +129,9 @@ public class CloseableReferenceCounter_Debug {
|
|||||||
|
|
||||||
@JvmName("withRef\$kt")
|
@JvmName("withRef\$kt")
|
||||||
public inline fun <R> withRef(protected: () -> R): R {
|
public inline fun <R> withRef(protected: () -> R): R {
|
||||||
|
contract {
|
||||||
|
callsInPlace(protected, InvocationKind.EXACTLY_ONCE)
|
||||||
|
}
|
||||||
this.incref()
|
this.incref()
|
||||||
return safeAutoClose1(finally = this::decref, action = protected)
|
return safeAutoClose1(finally = this::decref, action = protected)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,9 +95,9 @@ public class CloseableReferenceCounter_Debug {
|
|||||||
|
|
||||||
@JvmName("withRef\$kt")
|
@JvmName("withRef\$kt")
|
||||||
public inline fun <R> withRef(protected: () -> R): R {
|
public inline fun <R> withRef(protected: () -> R): R {
|
||||||
/*contract {
|
contract {
|
||||||
callsInPlace(protected, InvocationKind.EXACTLY_ONCE)
|
callsInPlace(protected, InvocationKind.EXACTLY_ONCE)
|
||||||
}*/
|
}
|
||||||
return this._moved.withRef(protected)
|
return this._moved.withRef(protected)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user