(&self, bytes: &[u8], hash: u64)
| 145 | unsafe impl Send for VmString {} |
| 146 | unsafe impl Sync for VmString {} |
| 147 | |
| 148 | type StringBucket = SmallVec<VmString, 2>; |
| 149 | |
| 150 | #[derive(Debug)] |
| 151 | pub struct StringPool { |
| 152 | data_buffer: GrowableAtomicBump<'static>, |
| 153 | |
| 154 | interned_strings: DashMap<u64, StringBucket, IdentityBuild>, |
| 155 | } |
| 156 | |
| 157 | #[derive(Debug)] |
| 158 | pub struct ThreadLocalStringPool<'a> { |
| 159 | global: &'a StringPool, |
| 160 | local_strings: HashMap<u64, StringBucket, IdentityBuild>, |
| 161 | } |
| 162 | |
| 163 | impl StringPool { |
| 164 | #[inline] |
| 165 | pub fn new() -> Result<Self, AllocError> { |
| 166 | Ok(Self { |
| 167 | data_buffer: GrowableAtomicBump::with_capacity_and_aligned(2 * MEGABYTE, 32)?, |
| 168 | |
| 169 | interned_strings: DashMap::with_hasher(IdentityBuild), |
| 170 | }) |
no test coverage detected