Skip to content

Add dashmap feature with GetSize impls for DashMap and DashSet#48

Merged
bircni merged 2 commits into
bircni:mainfrom
AlJohri:add-dashmap-feature
May 15, 2026
Merged

Add dashmap feature with GetSize impls for DashMap and DashSet#48
bircni merged 2 commits into
bircni:mainfrom
AlJohri:add-dashmap-feature

Conversation

@AlJohri

@AlJohri AlJohri commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional dashmap Cargo feature exposing GetSize impls for dashmap::DashMap and dashmap::DashSet.
  • Mirrors the std HashMap / HashSet impl in impls/collections.rs: iterate entries (under DashMap's per-shard read locks), sum each key/value's heap size, plus capacity() * size_of::<(K, V)>() for the bucket allocation.

Notes

  • Neither get-size2 nor mem_dbg-rs had dashmap support before this — no upstream reference impl to cross-check against.
  • default-features = false on the dashmap dep matches the convention used by the other optional deps in this crate.

Test plan

  • cargo test -p get-size2 --features dashmap test_dashmap
  • cargo test --all-features (36 unit + 8 derive doctests + 12 lib doctests, all green)

@AlJohri AlJohri marked this pull request as ready for review May 14, 2026 19:34
@bircni

bircni commented May 15, 2026

Copy link
Copy Markdown
Owner

thank you! new release will come later today

@bircni bircni merged commit faf1b09 into bircni:main May 15, 2026
6 checks passed
@AlJohri AlJohri deleted the add-dashmap-feature branch May 15, 2026 11: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