Clippy threw some lints, so I just fixed them. In most cases, this was pretty straightforward. One lint was a little more involved: in LockFreeFrozenVec, I added a // ## Safety comment that mirrored the comments elsewhere in the codebase:
/// Load an element (if it exists). This operation is lock-free and
/// performs no synchronized atomic operations. This is a useful primitive to
/// implement your own data structure with newtypes around the index.
///
/// ## Safety
///
/// `index` must be in bounds, i.e. it must be less than `self.len()`
#[inline]
pub unsafe fn get_unchecked(&self, index: usize) -> T {
let buffer_idx = buffer_index(index);
let buffer_ptr = self.data[buffer_idx].load(Ordering::Relaxed);
let local_index = index - prior_total_buffer_size(buffer_idx);
unsafe { *buffer_ptr.add(local_index) }
}
However, a LockFreeFrozenVec::len method didn't exist, so I wrapped the existing calls to self.len.load(Ordering::Acquire):
This modified the code in LockFreeFrozenVec::is_empty, which previously used Ordering::Relaxed. However, since stores always use Ordering::Release, there is no visible behavior change.
Clippy threw some lints, so I just fixed them. In most cases, this was pretty straightforward. One lint was a little more involved: in
LockFreeFrozenVec
, I added a// ## Safety
comment that mirrored the comments elsewhere in the codebase:However, a
LockFreeFrozenVec::len
method didn't exist, so I wrapped the existing calls toself.len.load(Ordering::Acquire)
:This modified the code in
LockFreeFrozenVec::is_empty
, which previously usedOrdering::Relaxed
. However, since stores always useOrdering::Release
, there is no visible behavior change.