-
Notifications
You must be signed in to change notification settings - Fork 3k
Call HAL free functions from C++ destructors #13318
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
Conversation
Add missing calls to HAL free to the following drivers - AnalogIn - QSPI - SerialBase
1c307c2
to
9e4be5e
Compare
@kyle-cypress, thank you for your changes. |
I don't think this is intended to be in a patch (should be at least feature, but this could be major?). This makes sense to do, just need to understand the consequences here and how to make it backward compatible. |
Do you know PR/issue #'s for the previous attempts to add destructors? I did a quick search and the closest I found was #10843 which says it was superceded by #10924, the latter of which does not modify the destructors, and it is not clear from the (lengthy) discussion whether that was a deliberate omission. I recall discussions in the past around adding free() functions that were previously missing from the HAL layer, and I know care had to be taken there to not break existing HAL implementations that didn't define a free() function. But I'm having trouble thinking of what issues would arise when updating the C++ layer to call free() functions that already exist in the HAL layer. The greentea tests should already be exercising those free() functions to make sure that they are safe to call. |
Thanks for the references. That helps now. @ARMmbed/mbed-os-hal Please review |
} | ||
|
||
if (_rx_enabled || _tx_enabled) { | ||
serial_free(&_serial); |
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 wonder how come this was not added in #10924 where we have added enable/disable output.
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Approved by @andypowers |
Summary of changes
Add missing calls to HAL free to the following drivers
Impact of changes
Resources will be properly freed when using these drivers through the C++ layer.
Migration actions required
NA
Documentation
NA
Pull request type
Test results
The TIMEOUT failures are a test infrastructure issue; they do not repeat when rerun manually.
All other failures are known, pre-existing issues.
CY8CKIT_062_WIFI_BT-GCC_ARM-NET.txt
CY8CPROTO_062_4343W-GCC_ARM-NET.txt
CY8CPROTO_062S3_4343W-GCC_ARM-NET.txt
CYW9P62S1_43012EVB_01-GCC_ARM-NET.txt
GT_FT_KIT_062_BLE_GCC.txt
GT_FT_KIT_062_WIFI_BT_GCC.txt
GT_FT_KIT_062S2_43012_GCC.txt
GT_FT_P6S1_43012EVB_01_GCC.txt
GT_FT_P6S1_43438EVB_01_GCC_NET.txt
GT_FT_P6S1_43438EVB_01_GCC.txt
GT_FT_PROTO_062_4343W_GCC.txt
GT_FT_PROTO_062S3_4343W.txt
GT-FT-KIT-062S2-43012-GCC-NET.txt
Reviewers
@ARMmbed/team-cypress