Skip to content

Commit f55b5dd

Browse files
committed
fix: correct typos in documentation and comments for SPSCRingBuffer
1 parent 7981f2f commit f55b5dd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/spscringbufferv2/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::sync::{AtomicUsize, Ordering};
33
use std::cell::{Cell, UnsafeCell};
44
use std::ptr;
55

6-
/// Single-Producer-Single-Consumer Ring Buffer
7-
/// Cache line optimized
6+
/// Single-Producer-Single-Consumer Ring Buffer.
7+
/// (cache line optimized)
88
#[allow(dead_code)]
99
pub struct SPSCRingBuffer<T> {
1010
capacity: usize,
@@ -40,8 +40,8 @@ where
4040
pub fn try_produce(&self, value: T) -> bool {
4141
let current_tail = self.tail.load(Ordering::Relaxed);
4242

43-
// Cache line optimisations
44-
// Refresh cached_head only when the buffer *appears* full based on stale cache
43+
// Cache line optimizations
44+
// Обновлять cached_head только если буфер *кажется* заполненным на основе устаревшего кэша
4545
if self.next(current_tail) == self.cached_head.get() {
4646
self.cached_head.set(self.head.load(Ordering::Acquire));
4747
}
@@ -65,8 +65,8 @@ where
6565
pub fn try_consume(&self) -> Option<T> {
6666
let current_head = self.head.load(Ordering::Relaxed);
6767

68-
// Cache line optimisations
69-
// Refresh cached_tail only when the buffer *appears* empty based on stale cache
68+
// Cache line optimizations
69+
// Обновлять cached_head только если буфер *кажется* заполненным на основе устаревшего кэша
7070
if current_head == self.cached_tail.get() {
7171
self.cached_tail.set(self.tail.load(Ordering::Acquire));
7272
}

0 commit comments

Comments
 (0)