pub struct HandleTable { /* private fields */ }Expand description
| We provide our own simple hash table since it | removes a whole bunch of porting hacks and is | also faster than some of the built-in hash | table implementations in some of the | compiler/runtime combinations we have tested. | E.g., readrandom speeds up by ~5% over the g++ | 4.4.3’s builtin hashtable.
Implementations§
Source§impl HandleTable
impl HandleTable
pub fn lookup(&mut self, key_: &Slice, hash_: u32) -> *mut LRUHandle
pub fn insert(&mut self, h: *mut LRUHandle) -> *mut LRUHandle
pub fn remove(&mut self, key_: &Slice, hash_: u32) -> *mut LRUHandle
Sourcepub fn find_pointer(&mut self, key_: &Slice, hash_: u32) -> *mut *mut LRUHandle
pub fn find_pointer(&mut self, key_: &Slice, hash_: u32) -> *mut *mut LRUHandle
| Return a pointer to slot that points to | a cache entry that matches key/hash. If | there is no such cache entry, return | a pointer to the trailing slot in the | corresponding linked list.
pub fn resize(&mut self)
Trait Implementations§
Source§impl Default for HandleTable
impl Default for HandleTable
Source§fn default() -> HandleTable
fn default() -> HandleTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HandleTable
impl RefUnwindSafe for HandleTable
impl !Send for HandleTable
impl !Sync for HandleTable
impl Unpin for HandleTable
impl UnwindSafe for HandleTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more