Add canary and journaling.

MozReview-Commit-ID: 582ZiTmcvgs
This commit is contained in:
Bobby Holley 2017-10-05 14:51:33 -07:00
parent f5c5be00a7
commit 58322d0021
3 changed files with 90 additions and 10 deletions

View file

@ -182,7 +182,7 @@ pub struct GapThenFull<K, V, M> {
/// A hash that is not zero, since we use a hash of zero to represent empty
/// buckets.
#[derive(PartialEq, Copy, Clone)]
#[derive(PartialEq, Copy, Clone, Debug)]
pub struct SafeHash {
hash: HashUint,
}
@ -816,6 +816,12 @@ impl<K, V> RawTable<K, V> {
}
}
/// Returns a raw pointer to the table's buffer.
#[inline]
pub fn raw_buffer(&self) -> *const u8 {
self.hashes.ptr() as *const u8
}
/// Creates a new raw table from a given capacity. All buckets are
/// initially empty.
pub fn new(capacity: usize) -> Result<RawTable<K, V>, FailedAllocationError> {