Skip to content
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

Replace triomphe::Arc with our own MiniArc type #47

Open
wants to merge 3 commits into
base: v0.11.x
Choose a base branch
from

Conversation

tatsuya6502
Copy link
Member

@tatsuya6502 tatsuya6502 commented Jan 11, 2025

This PR adds a private MiniArc type. It is a minimal implementation of atomic reference counted shared pointer. It is like a std::sync::Arc and triomphe::Arc but with a few differences:

  • No Weak references, so MiniArc does not have the weak reference counter.
  • Uses AtomicU32 instead of AtomicUsize for the strong reference counter.
  • Much smaller code size (~100 lines) by having only the necessary methods for moka and mini-moka.

MiniArc replaces all triomphe::Arc usages in moka.

On the CI (GitHub Actions), the following tests are performed in addition to the regular tests:

  • Miri tests on MiniArc.
  • Loom tests on MiniArc.

@tatsuya6502 tatsuya6502 added this to the v0.11.0 milestone Jan 11, 2025
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.

CI: Run miri using tree borrows in addition to the existing stacked borrows
1 participant