Skip to content

Conversation

kyle-cypress
Copy link

Summary of changes

Add missing calls to HAL free to the following drivers

  • AnalogIn
  • QSPI
  • SerialBase

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

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

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

@mergify mergify bot added the needs: work label Jul 20, 2020
Add missing calls to HAL free to the following drivers
- AnalogIn
- QSPI
- SerialBase
@kyle-cypress kyle-cypress force-pushed the pr/destructors-free branch from 1c307c2 to 9e4be5e Compare July 20, 2020 19:15
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jul 20, 2020
@ciarmcom ciarmcom requested review from a team July 20, 2020 21:00
@ciarmcom
Copy link
Member

@kyle-cypress, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 requested a review from a team July 21, 2020 12:50
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 22, 2020

I don't think this is intended to be in a patch (should be at least feature, but this could be major?).
We previously had similar attempts , have you reviewed them what challenges are there including these in destructors ? Couple of HAL were updated to with defined behavior, they should be safe to be called but the rest - I don't think so.

This makes sense to do, just need to understand the consequences here and how to make it backward compatible.

@kyle-cypress
Copy link
Author

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.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 27, 2020

Thanks for the references. That helps now.

@ARMmbed/mbed-os-hal Please review

}

if (_rx_enabled || _tx_enabled) {
serial_free(&_serial);
Copy link
Contributor

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.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 27, 2020

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Jul 27, 2020
@mbed-ci
Copy link

mbed-ci commented Jul 27, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@adbridge
Copy link
Contributor

Approved by @andypowers

@adbridge adbridge merged commit 67e6052 into ARMmbed:master Jul 28, 2020
@adbridge adbridge added release-version: 5.15.5 and removed ready for merge release-type: patch Indentifies a PR as containing just a patch labels Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants