Switch to rustc-hash

This commit is contained in:
Gwilym Kuiper 2022-02-07 23:22:19 +00:00
parent 06901b3543
commit 3941117aa7
3 changed files with 18 additions and 8 deletions

19
agb/Cargo.lock generated
View file

@ -25,6 +25,7 @@ dependencies = [
"bare-metal",
"bitflags",
"hashbrown",
"rustc-hash",
]
[[package]]
@ -97,9 +98,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bytemuck"
version = "1.7.3"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
checksum = "0e851ca7c24871e7336801608a4797d7376545b6928a10d32d75685687141ead"
[[package]]
name = "byteorder"
@ -236,15 +237,15 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.9.0"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
[[package]]
name = "png"
version = "0.17.4"
version = "0.17.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02cd7d51cea7e2fa6bbcb8af5fbcad15b871451bfc2d20ed72dff2f4ae072a84"
checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba"
dependencies = [
"bitflags",
"crc32fast",
@ -306,6 +307,12 @@ dependencies = [
"getrandom",
]
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "serde"
version = "1.0.136"

View file

@ -27,6 +27,7 @@ agb_sound_converter = { version = "0.1.0", path = "../agb-sound-converter" }
agb_macros = { version = "0.1.0", path = "../agb-macros" }
agb_fixnum = { version = "0.1.0", path = "../agb-fixnum" }
bare-metal = "1.0"
rustc-hash = { version = "1.0", default-features = false }
[package.metadata.docs.rs]
default-target = "thumbv6m-none-eabi"

View file

@ -1,9 +1,11 @@
use core::cell::RefCell;
use core::hash::BuildHasherDefault;
use core::ops::{Deref, DerefMut};
use alloc::vec::Vec;
use alloc::{boxed::Box, vec};
use hashbrown::HashMap;
use rustc_hash::FxHasher;
use crate::bitarray::Bitarray;
use crate::{
@ -95,7 +97,7 @@ pub struct VRamManager<'a> {
generation: u16,
free_pointer: Option<usize>,
tile_set_to_vram: HashMap<TileReference, (u16, u16)>,
tile_set_to_vram: HashMap<TileReference, (u16, u16), BuildHasherDefault<FxHasher>>,
references: Vec<VRamState>,
vram_free_pointer: Option<usize>,
}
@ -109,7 +111,7 @@ impl<'a> VRamManager<'a> {
generation: 0,
free_pointer: None,
tile_set_to_vram: HashMap::new(),
tile_set_to_vram: HashMap::default(),
references: vec![VRamState::Free(0)],
vram_free_pointer: None,
}