Skip to content

Comments

memorypool: add optional support for the system allocator in Rc#48305

Merged
jkarneges merged 1 commit intomainfrom
jkarneges/rc-system
Feb 11, 2026
Merged

memorypool: add optional support for the system allocator in Rc#48305
jkarneges merged 1 commit intomainfrom
jkarneges/rc-system

Conversation

@jkarneges
Copy link
Member

@jkarneges jkarneges commented Feb 11, 2026

This enables our custom Rc type to use the system allocator instead of a memory pool. The result is a single type that works either way, which will be useful for supporting collections of elements that have mixed memory backings. For ref-counted types not in collections, or for collections of ref-counted types where all elements use the system allocator, std::rc::Rc should be preferred.

Initially I considered making this work by forwarding calls to std::rc::Rc based on a flag, but that would have required adding branching overhead to every method. Instead, this change simply adds alternative construction/destruction logic and leaves clone/deref as-is.

@jkarneges jkarneges requested a review from a team February 11, 2026 19:17
@jkarneges jkarneges merged commit 6327179 into main Feb 11, 2026
19 checks passed
@jkarneges jkarneges deleted the jkarneges/rc-system branch February 11, 2026 21:38
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