Skip to content

Commit eebd7c5

Browse files
jamesmunnsJuliDi
andauthored
Apply suggestions from code review
Co-authored-by: Julian <[email protected]>
1 parent 3b19146 commit eebd7c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/intrusive.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ where
111111
/// morally: Option<&'static PinList<R>>
112112
/// We need to store the &'static PinList, which we might not get until runtime.
113113
list: AtomicPtr<PinList<R>>,
114-
/// This is a single waitcell which
114+
/// This is a single waitcell which handles waking when the `state` field has changed
115115
state_change: WaitCell,
116116

117117
/// The following parts are "observable" in the linked list. We put it inside
@@ -139,7 +139,8 @@ pub struct Node<T> {
139139
// should check this.
140140
_pin: PhantomPinned,
141141

142-
// We generally want this to be in the tail position, because
142+
// We generally want this to be in the tail position, because the size of T varies
143+
// and the pointer to the `NodeHeader` must not change as described above.
143144
t: MaybeUninit<T>,
144145
}
145146

@@ -223,6 +224,9 @@ pub enum State {
223224
/// TODO: Decide what our policy is for this: SHOULD we write default values
224225
/// back to flash, or keep them out of flash until there has been an explict
225226
/// change to the default value?
227+
/// If we don't flash it, we reduce wear on the flash and save some time.
228+
/// However, if the `default()` value changes (e.g., firmware update) this
229+
/// gives a different result.
226230
///
227231
/// In this state, `t` IS valid, and may be read at any time (by the holder
228232
/// of the lock).

0 commit comments

Comments
 (0)