Skip to content

Implement SegmentPool for all platforms.#1776

Open
MohammedKHC wants to merge 1 commit into
lysine-dev:masterfrom
MohammedKHC:native-pool
Open

Implement SegmentPool for all platforms.#1776
MohammedKHC wants to merge 1 commit into
lysine-dev:masterfrom
MohammedKHC:native-pool

Conversation

@MohammedKHC

Copy link
Copy Markdown
Contributor

Closes: #1629

Questions

  1. Should this even be implemented for JS?
  2. I think the js source set should be shared with wasmJs. Is there any reason this isn’t the case? I believe wasmJs should have access to the Node.js and browser APIs.
  3. Is it okay to use Kotlin’s AtomicReference? (currently it requires opting in to ExperimentalAtomicApi)
    On the JVM, it just maps to java.util.concurrent.atomic.AtomicReference anyway.

@MohammedKHC
MohammedKHC force-pushed the native-pool branch 4 times, most recently from ebe7306 to 8036bf2 Compare February 10, 2026 13:54
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Square, Inc.
* Copyright (C) 2026 Square, Inc.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a practice we don’t change these numbers

*/
internal expect object SegmentPool {
val MAX_SIZE: Int
@OptIn(ExperimentalAtomicApi::class)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can’t do this in Okio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Memory Allocation Optimization for String to Path Conversion on non-JVM Platforms

2 participants