-
Notifications
You must be signed in to change notification settings - Fork 226
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
Use own implementation instead of ROM functions, re-add memchr #2896
Conversation
|
||
// We cannot just use the ROM function since it calls `__getreent` | ||
// | ||
// From docs: The __getreent() function returns a per-task pointer to struct |
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.
I was looking into why on earth atoi
needed to be reentrant, it seems it can set errno
and therefore needs a thread local errno
to set to avoid race conditions - annoying.
esp-wifi/src/compat/misc.rs
Outdated
|
||
unsafe { | ||
let s = core::ffi::CStr::from_ptr(str); | ||
let s = s.to_str().unwrap(); |
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.
Any reason not to use count_bytes
here instead? It'd be ideal not to assume UTF-8 here by calling to_str()
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.
Agreed - not only are C strings not necessarily UTF8, the validation done by to_str
is annoyingly expensive.
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.
yeah - I just re-surrected this from an old commit without looking at it
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.
Can't confirm the magic numbers in the *.ld
files but the rest LGTM
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, thanks!
…nction
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
atoi
andstrdup
ROM-functions with our own implementation (to fix WPA2-ENTERPRISE functionality)memchr
ROM-function for ESP32, ESP32-C3 and ESP32-H2 (to fix the issue in Update dependencies foresp-hal
,esp-wifi
andembassy-net
esp-mbedtls#62)skip-changelog
b.c. of the changes inesp-hal
Testing
WPA2-ENTERPRISE example (have it locally - can provide if needed)