Skip to content

refactor(moonbit): use ordered maps for async handle registries - #1756

Draft
peter-jerry-ye wants to merge 1 commit into
bytecodealliance:mainfrom
peter-jerry-ye:codex/moonbit-ordered-runtime-maps
Draft

peter-jerry-ye wants to merge 1 commit into
bytecodealliance:mainfrom
peter-jerry-ye:codex/moonbit-ordered-runtime-maps

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Contributor

Component Model handles are supplied by the host and may be sparse. Replace the generated MoonBit runtime's handle-keyed hash maps with the standard library's mutable SortedMap, giving component-task, waitable-subscriber, and prepared future/stream producer registries logarithmic lookup, insertion, and removal without depending on hash distribution.

The change preserves the existing registration and removal points, including removing producer entries before starting bridges or running cleanup. Generated packages import moonbitlang/core/sorted_map only when they emit producer tables; external imports share the existing alias namespace to prevent collisions.

This is an independent follow-up to #1742 so the resource ownership changes can land separately. Public WIT map types, resource representations, coroutine membership sets, and CI configuration retain their existing behavior. The collection comes from the standard library and adds no third-party dependency.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant