Skip to content

Conversation

@jkarneges
Copy link
Member

@jkarneges jkarneges commented Jan 22, 2026

This renames the constructor from new to try_new_in, and impls Deref and Clone, to match how std's API works. This does a few things for us:

  • Frees up new which we can reintroduce after this lands for using the system allocator instead of a memory pool. Having a single Rc type able to work with both kinds of memory sources is the optimal approach for supporting both in our linked list nodes (as opposed to wrapping two different Rc types in an enum and using that for links).
  • Once we have both new and try_new_in, our Rc basically becomes a mirror of std while we wait for the allocator API to stabilize.
  • Tracking std makes it easier to swap between our type and std, for benchmarks or possible removal.

@jkarneges jkarneges requested a review from a team January 22, 2026 23:48
@jkarneges jkarneges merged commit c53c58b into main Jan 23, 2026
19 checks passed
@jkarneges jkarneges deleted the jkarneges/rc-like-std branch January 23, 2026 18:06
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.

3 participants