Merged
Conversation
81ca592 to
3cd0737
Compare
Berrysoft
previously approved these changes
Apr 13, 2026
There was a problem hiding this comment.
Pull request overview
Adds an optional weak feature to ThinCell (sync + unsync) to support non-owning Weak<T> handles, including separate strong/weak refcount tracking and accompanying tests/docs.
Changes:
- Introduces
Weak<T>plusThinCell::{downgrade,strong_count,weak_count}behindcfg(feature = "weak"). - Refactors refcount state representation to track strong + weak counts (and updates state tests).
- Adds sync weak-reference tests and updates CI/docs to build & test with all features.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Adds Weak<T> API and weak-aware drop/upgrade logic. |
src/state/mod.rs |
Adds strong/weak bit layout and weak-aware Snapshot helpers. |
src/state/macros.rs |
Implements strong/weak refcount ops (inc_weak, try_inc, dec_weak, etc.) and weak-specific tests. |
src/sync/mod.rs |
Adds Send/Sync impls for Weak<T> under the feature flag. |
tests/sync.rs |
Adds weak-gated multithreaded tests for downgrade/upgrade/count behavior. |
README.md |
Documents the new weak feature and provides an example. |
Cargo.toml |
Defines the weak feature and enables docs.rs all-features docs build. |
.github/workflows/ci_test.yml |
Runs cargo test --all-features in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3cd0737 to
a79798b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.