Skip to content

Commit

Permalink
feat: add flag to force hashbrown usage (#1284)
Browse files Browse the repository at this point in the history
* feat: add flag to force hashbrown usage

* misc: propagate hashbrown feature flag
  • Loading branch information
Wodann authored Apr 13, 2024
1 parent cfc4511 commit e0f72a0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ required-features = ["serde"]
[features]
default = ["std"]
std = ["serde?/std", "revm-primitives/std"]
hashbrown = ["revm-primitives/hashbrown"]
serde = ["dep:serde", "revm-primitives/serde"]
arbitrary = ["std", "revm-primitives/arbitrary"]
asm-keccak = ["revm-primitives/asm-keccak"]
Expand Down
1 change: 1 addition & 0 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ std = [
"c-kzg?/std",
"secp256k1?/std",
]
hashbrown = ["revm-primitives/hashbrown"]
asm-keccak = ["revm-primitives/asm-keccak"]

optimism = ["revm-primitives/optimism"]
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ std = [
"bitvec/std",
"bitflags/std",
]
hashbrown = []
serde = [
"dep:serde",
"alloy-primitives/serde",
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use constants::*;
pub use env::*;

cfg_if::cfg_if! {
if #[cfg(feature = "std")] {
if #[cfg(all(not(feature = "hashbrown"), feature = "std"))] {
pub use std::collections::{hash_map, hash_set, HashMap, HashSet};
use hashbrown as _;
} else {
Expand Down
1 change: 1 addition & 0 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ std = [
"revm-interpreter/std",
"revm-precompile/std",
]
hashbrown = ["revm-interpreter/hashbrown", "revm-precompile/hashbrown"]
serde = ["dep:serde", "revm-interpreter/serde"]
serde-json = ["serde", "dep:serde_json"]
arbitrary = ["revm-interpreter/arbitrary"]
Expand Down

0 comments on commit e0f72a0

Please sign in to comment.