mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Revert "Write poison to canary when removing item from diagnostic hashmap"
This reverts commit b547e96b44
.
This commit is contained in:
parent
2931e71d40
commit
f9eff7f546
1 changed files with 0 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
use hash_map::HashMap;
|
||||
use std::borrow::Borrow;
|
||||
use std::hash::{BuildHasher, Hash};
|
||||
use std::ptr;
|
||||
|
||||
use FailedAllocationError;
|
||||
|
||||
|
@ -10,11 +9,6 @@ const CANARY: usize = 0x42cafe99;
|
|||
#[cfg(target_pointer_width = "64")]
|
||||
const CANARY: usize = 0x42cafe9942cafe99;
|
||||
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
const POISON: usize = 0xdeadbeef;
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
const POISON: usize = 0xdeadbeefdeadbeef;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
enum JournalEntry {
|
||||
Insert(usize),
|
||||
|
@ -136,9 +130,6 @@ impl<K: Hash + Eq, V, S: BuildHasher> DiagnosticHashMap<K, V, S>
|
|||
{
|
||||
assert!(!self.readonly);
|
||||
self.journal.push(JournalEntry::Remove(self.map.make_hash(k).inspect()));
|
||||
if let Some(v) = self.map.get_mut(k) {
|
||||
unsafe { ptr::write_volatile(&mut v.0, POISON); }
|
||||
}
|
||||
self.map.remove(k).map(|x| x.1)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue