-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent some leaks & a bit of cleanup #306
Conversation
b3ad89b
to
a829d22
Compare
res | ||
_ => { | ||
debug!("RX QUEUE FULL"); | ||
include::ESP_ERR_NO_MEM as esp_err_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should still do esp_wifi_internal_free_rx_buffer(eb);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done by EspWifiPacketBuffer::drop
, or at least that is the intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see .... I should stop reviewing code via GH UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I should probably start describing my changes in more detail so you have the answers before you need to ask 😅
@@ -1303,6 +1306,8 @@ pub(crate) mod embassy { | |||
cx: &mut core::task::Context, | |||
) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> { | |||
RECEIVE_WAKER.register(cx.waker()); | |||
TRANSMIT_WAKER.register(cx.waker()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we register the TRANSMIT_WAKER here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's technically possible that we return None because we can't create a TxToken. TRANSMIT_WAKER is supposed to signal a change in this state. Since we are registering wakers all over the place regardless of whether they are actually needed, I was thinking "why not".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.