Skip to content

feat: multithread support - #3

Merged
George-Miao merged 2 commits into
mainfrom
feat/mt
Mar 6, 2026
Merged

George-Miao merged 2 commits into
mainfrom
feat/mt

Conversation

@George-Miao

Copy link
Copy Markdown
Member
  • feat: coerce to slice
  • feat: multithread support

@George-Miao George-Miao self-assigned this Mar 6, 2026
@George-Miao George-Miao added the enhancement New feature or request label Mar 6, 2026
@George-Miao
George-Miao requested a review from Berrysoft March 6, 2026 03:35
@George-Miao
George-Miao marked this pull request as ready for review March 6, 2026 03:35
Copilot AI review requested due to automatic review settings March 6, 2026 03:35
@George-Miao
George-Miao force-pushed the feat/mt branch 2 times, most recently from 5429616 to 1742fd9 Compare March 6, 2026 03:39

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 refactors the crate toward supporting both single-threaded and multi-threaded variants of ThinCell, and adds an array-to-slice coercion helper, alongside README and dependency updates.

Changes:

  • Refactor core ThinCell implementation behind a thin_cell! macro and introduce sync/unsync module structure.
  • Rename fat-pointer helper to is_sized (inverse of previous is_fat).
  • Update README to describe sync vs unsync borrow semantics and add synchrony dependency.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/tests.rs Removed existing integration tests for ThinCell.
tests/send_sync.rs Removed compile-time/runtime Send/Sync assertions.
src/state.rs Removed previous State implementation and its unit tests.
src/lib.rs Refactors implementation into a macro and declares new sync/unsync modules.
src/fat_ptr.rs Renames/changes fat-pointer sizing helper (is_fat → is_sized).
README.md Updates crate description and documents new sync/unsync borrow behavior.
Cargo.toml Adds synchrony dependency.
Cargo.lock Locks synchrony dependency.
flake.nix Simplifies dev shell inputs (adds cargo-nextest).
Comments suppressed due to low confidence (1)

README.md:33

  • The “Simplified layout” snippet is marked as Rust; it’s currently not valid syntax because it’s missing a comma after state: usize. Fixing the snippet avoids confusing readers copying it into code.
struct Inner<T> {
    metadata: usize,
    state: usize
    data: T,
}

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

Comment thread src/lib.rs Resolved
Comment thread src/fat_ptr.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread Cargo.toml Resolved

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.


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

Comment thread src/unsync/state.rs Resolved
Comment thread tests/sync.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/fat_ptr.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread src/lib.rs Resolved
Comment thread README.md Resolved
@George-Miao
George-Miao merged commit d619dc3 into main Mar 6, 2026
8 checks passed
@George-Miao
George-Miao deleted the feat/mt branch March 6, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants