diff --git a/crossbeam-epoch/src/internal.rs b/crossbeam-epoch/src/internal.rs index fd1d9c6d5..8ebb4ae7c 100644 --- a/crossbeam-epoch/src/internal.rs +++ b/crossbeam-epoch/src/internal.rs @@ -292,9 +292,6 @@ pub(crate) struct Local { /// A node in the intrusive linked list of `Local`s. entry: Entry, - /// The local epoch. - epoch: AtomicEpoch, - /// A reference to the global data. /// /// When all guards and handles get dropped, this reference is destroyed. @@ -315,6 +312,9 @@ pub(crate) struct Local { prev_epoch: Cell, collecting: Cell, + + /// The local epoch. + epoch: CachePadded, } // Make sure `Local` is less than or equal to 2048 bytes. @@ -343,7 +343,6 @@ impl Local { let local = Owned::new(Local { entry: Entry::default(), - epoch: AtomicEpoch::new(Epoch::starting()), collector: UnsafeCell::new(ManuallyDrop::new(collector.clone())), bag: UnsafeCell::new(Bag::new()), guard_count: Cell::new(0), @@ -352,6 +351,7 @@ impl Local { advance_count: Cell::new(0), prev_epoch: Cell::new(Epoch::starting()), collecting: Cell::new(false), + epoch: CachePadded::new(AtomicEpoch::new(Epoch::starting())), }) .into_shared(unprotected()); collector.global.locals.insert(local, unprotected());