Skip to content

Add a concurrent, append-only SlotMap#31

Open
SabrinaJewson wants to merge 2 commits intoibraheemdev:masterfrom
SabrinaJewson:slotcar
Open

Add a concurrent, append-only SlotMap#31
SabrinaJewson wants to merge 2 commits intoibraheemdev:masterfrom
SabrinaJewson:slotcar

Conversation

@SabrinaJewson
Copy link
Contributor

Apologies for the rewrite-your-entire-crate PR, but you did say I could do this =)

In this PR, we split the logic of Vec into two parts: an underlying Buckets type, which manages the exponentially-growing sequence of buckets, and Vec itself, which wraps Buckets by managing initialization and length. We then write SlotMap in terms of Buckets, allowing the implementation to focus on the algorithm, while hiding details of arithmetic and allocation.

We have API parity with regular slotmap (at the time of writing), though not an identical API.

@SabrinaJewson
Copy link
Contributor Author

Oh, right. CI is failing for two reasons:

  1. MSRV, which needs 1.83. I already bumped to 1.81.0, but I should ask what the policy is here.
  2. I moved boxcar::{Iter, IntoIter}boxcar::vec::{Iter, IntoIter}. If we’re making a breaking change anyway then we might as well keep, but if MSRV isn’t a breaking change then I could reexport.

@ibraheemdev
Copy link
Owner

Thanks, this looks really cool! Just a heads up that it might take me a little while to get around to reviewing it, but the overall direction looks great.

@ibraheemdev
Copy link
Owner

What do you think about splitting the buckets API into a separate PR (apart from the new slotmap API)? That would make it easier to review, and hopefully we could merge that part sooner and avoid having to keep it in-sync with new changes — it's already been a while and I'd like to get those changes in. It's also possible that the slotmap API could be a separate crate (but we can have that discussion in the other PR).

@SabrinaJewson SabrinaJewson mentioned this pull request Jun 19, 2025
@SabrinaJewson
Copy link
Contributor Author

Alright, I’ve now rebased on master. And CI passes =)

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.

2 participants

Comments