mirror of https://github.com/aya-rs/aya
Add HashMap::from_map_data to allow safe creation from pinned maps
Issue: https://github.com/aya-rs/aya/issues/1305 This change introduces a public constructor `HashMap::from_map_data`, enabling safe and ergonomic creation of HashMap<MapData, K, V> from a pinned BPF map. Previously, this required reloading the full BPF object or using unsafe/private APIs. Motivation: - Simplifies accessing pinned maps in multi-threaded user space - Avoids full BPF reloads and potential deadlocks - Matches existing ergonomic APIs like LruHashMap::try_from - Keeps user code safe and idiomatic Includes test coverage to validate the new API.reviewable/pr1306/r1
parent
44ec978bd3
commit
46d30c72f5
Loading…
Reference in New Issue