Skip to content

feat: add OOM safe constructors - #372

Open
khanhtranngoccva wants to merge 4 commits into
xacrimon:masterfrom
khanhtranngoccva:oom-safe
Open

feat: add OOM safe constructors#372
khanhtranngoccva wants to merge 4 commits into
xacrimon:masterfrom
khanhtranngoccva:oom-safe

Conversation

@khanhtranngoccva

@khanhtranngoccva khanhtranngoccva commented Aug 6, 2026

Copy link
Copy Markdown

I am currently attempting to implement a OOM friendly polyfill for standard popular Rust data structures.

The current API of DashMap is not sufficient to allow implementing OOM-safe abstractions on top of it. Currently, the HashSet lacks facilities to retrieve the hasher to implement TryClone semantics, and for both types, there are no constructors that can fallibly deal with initial allocation, making try_reserve much less useful in practice.

This PR is a minimal attempt to allow construction of DashMap and DashSet fallibly. It also exposes the ability of DashSet to cast and convert to and from DashMap to implement polyfills if any needed low level API is somehow missing.

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.

1 participant