mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 15:04:33 -05:00
chore: support 128-bit TypeId (#1249)
This commit is contained in:
parent
5a15d85f2f
commit
270f46aa5f
1 changed files with 10 additions and 2 deletions
|
@ -1686,6 +1686,8 @@ impl Hasher for TypeIdHasher {
|
|||
|
||||
#[inline]
|
||||
fn write_u64(&mut self, value: u64) {
|
||||
// The internal hash function of TypeId only takes the bottom 64-bits, even on versions
|
||||
// of Rust that use a 128-bit TypeId.
|
||||
let prev_state = self.state.replace(value);
|
||||
debug_assert_eq!(prev_state, None);
|
||||
}
|
||||
|
@ -1712,8 +1714,14 @@ impl BuildHasher for BuildTypeIdHasher {
|
|||
}
|
||||
|
||||
const _: () = {
|
||||
assert!(size_of::<TypeId>() == size_of::<u64>());
|
||||
assert!(align_of::<TypeId>() == align_of::<u64>());
|
||||
assert!(
|
||||
size_of::<TypeId>() == size_of::<u64>()
|
||||
|| size_of::<TypeId>() == size_of::<u128>()
|
||||
);
|
||||
assert!(
|
||||
align_of::<TypeId>() == align_of::<u64>()
|
||||
|| align_of::<TypeId>() == align_of::<u128>()
|
||||
);
|
||||
};
|
||||
|
||||
pub(crate) struct RawSlot {
|
||||
|
|
Loading…
Reference in a new issue