Skip to content
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

Merged
merged 6 commits into from
Oct 26, 2023
Merged

Prevent some leaks & a bit of cleanup #306

merged 6 commits into from
Oct 26, 2023

Conversation

bugadani
Copy link
Contributor

No description provided.

@bugadani bugadani marked this pull request as draft October 25, 2023 15:24
@bugadani bugadani force-pushed the leak branch 3 times, most recently from b3ad89b to a829d22 Compare October 25, 2023 16:44
@bugadani bugadani marked this pull request as ready for review October 25, 2023 16:47
res
_ => {
debug!("RX QUEUE FULL");
include::ESP_ERR_NO_MEM as esp_err_t
Copy link
Contributor

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);

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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 😅

esp-wifi/src/wifi/mod.rs Outdated Show resolved Hide resolved
@@ -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());
Copy link
Contributor

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?

Copy link
Contributor Author

@bugadani bugadani Oct 26, 2023

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".

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjoernQ bjoernQ merged commit b866506 into esp-rs:main Oct 26, 2023
7 checks passed
@bugadani bugadani deleted the leak branch October 26, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants