Skip to content

Conversation

@GordonSmith
Copy link
Owner

No description provided.

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
@GordonSmith GordonSmith requested a review from Copilot September 28, 2025 10:27
Copy link
Contributor

Copilot AI left a 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_if utility 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>
Copy link

Copilot AI Sep 28, 2025

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.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.04%. Comparing base (af57bb6) to head (283f22d).

Files with missing lines Patch % Lines
include/cmcpp/context.hpp 94.11% 2 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

GordonSmith and others added 2 commits September 28, 2025 11:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@GordonSmith GordonSmith merged commit 67b7220 into trunk Sep 28, 2025
0 of 3 checks passed
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