-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Complete resource handle lifecycle #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
There was a problem hiding this comment.
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 implements resource handle lifecycle management for the WebAssembly Component Model, completing one of the major features outlined in the canonical ABI specification. The implementation adds proper resource handle tables, ownership tracking, and lifecycle management functions.
Key changes include:
- Adds complete resource handle infrastructure with ownership tracking and borrow counting
- Implements canonical resource management functions (
canon_resource_new,canon_resource_drop,canon_resource_rep) - Moves and enhances
trap_ifutility function to the context header where it's more logically placed
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
include/cmcpp/context.hpp |
Core implementation of resource handle tables, lifecycle management, and canonical resource functions |
include/cmcpp.hpp |
Adds context.hpp to public API surface |
include/cmcpp/util.hpp |
Removes trap_if function (moved to context.hpp) |
test/main.cpp |
Comprehensive test coverage for resource handle lifecycle behavior |
docs/issue-backlog.md |
Documents planned enhancements and implementation roadmap |
| #include <limits> | ||
| #include <cmath> | ||
| #include <cstdint> | ||
| #include <stdexcept> |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <stdexcept> include appears to be unused in the test file. The std::runtime_error is used in the lambda on line 216, but this could be replaced with the existing trap mechanism for consistency.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #12 +/- ##
==========================================
+ Coverage 85.27% 86.04% +0.77%
==========================================
Files 15 15
Lines 618 681 +63
Branches 39 43 +4
==========================================
+ Hits 527 586 +59
- Misses 71 73 +2
- Partials 20 22 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.