-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed shared segment leakage from the pool - Fixed segment leakage / excessive allocation when multiple threads taking / recycling them concurrently - Supported configurable second-level pool (4 MB by default, could be configured via `kotlinx.io.pool.size.bytes` system property)
- Loading branch information
Showing
11 changed files
with
394 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package kotlinx.io | ||
|
||
import kotlin.test.Test | ||
import kotlin.test.assertTrue | ||
|
||
class AlwaysSharedCopyTrackerTest { | ||
@Test | ||
fun stateTransition() { | ||
val tracker = AlwaysSharedCopyTracker | ||
assertTrue(tracker.shared) | ||
|
||
assertTrue(tracker.removeCopy()) | ||
assertTrue(tracker.shared) | ||
|
||
tracker.addCopy() | ||
assertTrue(tracker.shared) | ||
|
||
assertTrue(tracker.removeCopy()) | ||
assertTrue(tracker.shared) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.