Skip to content

Chore: Centralize P1 Opaque-Handle Tables#31

Merged
sephynox merged 2 commits into
mainfrom
feat/map-binding-registry
Jul 7, 2026
Merged

Chore: Centralize P1 Opaque-Handle Tables#31
sephynox merged 2 commits into
mainfrom
feat/map-binding-registry

Conversation

@sephynox

@sephynox sephynox commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces manual HashMap handle tables in the P1 core module with a generic HandleRegistry<T>.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes opaque-handle storage for the WASI Preview 1 (P1) core module by replacing per-type HashMap handle tables with a reusable, generic HandleRegistry<T> shared in keetanetwork-bindings.

Changes:

  • Introduced keetanetwork_bindings::registry::HandleRegistry<T> to manage non-zero handle allocation, lookup, and release with consistent INVALID_HANDLE errors.
  • Refactored keetanetwork-client-wasi P1 state to use HandleRegistry instances instead of manual next + HashMap tables.
  • Exported the new registry module from keetanetwork-bindings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
keetanetwork-client-wasi/src/p1/mod.rs Migrates P1 handle tables to HandleRegistry<T> and routes lookups/removals through the new API.
keetanetwork-bindings/src/registry.rs Adds the generic handle registry implementation plus unit tests.
keetanetwork-bindings/src/lib.rs Exposes the new registry module publicly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread keetanetwork-bindings/src/registry.rs
Comment thread keetanetwork-bindings/src/registry.rs
Comment thread keetanetwork-bindings/src/registry.rs
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@sephynox sephynox merged commit f773c94 into main Jul 7, 2026
7 checks passed
@sephynox sephynox mentioned this pull request Jul 7, 2026
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.

2 participants