Skip to content

Commit

Permalink
Support custom hashers in some impls
Browse files Browse the repository at this point in the history
Summary: As it says in the title. For now we don't track any of the possible memory usage by these hashers, but we wouldn't normally expect them to use significant memory.

Reviewed By: bobyangyf

Differential Revision: D41976482

fbshipit-source-id: 42364ca5a362af580eb083e0ca26531f481de0ee
  • Loading branch information
JakobDegen authored and facebook-github-bot committed Dec 20, 2022
1 parent f437ea6 commit 6129b1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions allocative/src/impls/std/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<K: Allocative> Allocative for BTreeSet<K> {
}
}

impl<K: Allocative, V: Allocative> Allocative for HashMap<K, V> {
impl<K: Allocative, V: Allocative, S> Allocative for HashMap<K, V, S> {
fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
let mut visitor = visitor.enter_self_sized::<Self>();
// TODO: can do better extra capacity.
Expand All @@ -42,7 +42,7 @@ impl<K: Allocative, V: Allocative> Allocative for HashMap<K, V> {
}
}

impl<K: Allocative> Allocative for HashSet<K> {
impl<K: Allocative, S> Allocative for HashSet<K, S> {
fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
let mut visitor = visitor.enter_self_sized::<Self>();
// TODO: can do better extra capacity.
Expand Down

0 comments on commit 6129b1c

Please sign in to comment.