autocommit 2022-01-31 23:45:42 CET
This commit is contained in:
parent
865d5f295d
commit
f2117256b9
33 changed files with 784 additions and 178 deletions
|
|
@ -28,4 +28,4 @@ pub enum BufFdError {
|
|||
|
||||
const BUF_SIZE: usize = 4096;
|
||||
const CMSG_BUF_SIZE: usize = 4096;
|
||||
const MAX_IN_FD: usize = 4;
|
||||
const MAX_IN_FD: usize = 32;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ impl<T: UnsafeCellCloneSafe> CloneCell<T> {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn set(&self, t: T) {
|
||||
pub fn set(&self, t: T) -> T {
|
||||
unsafe {
|
||||
let _ = mem::replace(self.data.get().deref_mut(), t);
|
||||
mem::replace(self.data.get().deref_mut(), t)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@ impl<K: Eq, V, const N: usize> SmallMap<K, V, N> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
unsafe {
|
||||
self.m.get().deref().len()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn insert(&self, k: K, v: V) -> Option<V> {
|
||||
unsafe {
|
||||
let m = self.m.get().deref_mut();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue