-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for issue #8368 #8377
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
Fix for issue #8368 #8377
Conversation
This is fix for issue 8368. Test is causing some problems on `REALTEK_RTL8195AM` and `ARM` compiler. There is some kind of memory issue. Probably there is not enough memory space for global data provided by the test. Data definitions have been moved into test function body so, they will land on stack. With this fix the test works on `REALTEK_RTL8195AM/ARM`.
@mprse thanks for the fix 👍 |
@M-ichae-l Here is the test code:
|
@ARMmbed/mbed-os-maintainers can you review? |
@@ -53,6 +51,7 @@ bool is_leap_year(int year) | |||
* When _rtc_is_leap_year() function is called. | |||
* Then _rtc_is_leap_year() returns true if given year is a leap year; false otherwise. | |||
*/ | |||
template <rtc_leap_year_support_t rtc_leap_year_support> |
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 is this defined twice?
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.
Sorry, but what is defined twice?
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.
Lines 54 and 93
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.
Because these are two different template functions. Is it possible to define one template for many functions? I have never seen such case.
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 just seemed odd to me, but our local C++ expert (@geky) mentioend that it's par for the course. I'm use to seeing templates be used in classes, not functions.
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.
Iiinteresting. Have a question, but should be good.
/morph build |
Build : SUCCESSBuild number : 3414 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 3040 |
Test : SUCCESSBuild number : 3210 |
Description
This is fix for issue #8368.
Test is causing some problems on
REALTEK_RTL8195AM
andARM
compiler. There is some kind of memory issue. Probably there is not enough memory space for global data provided by the test. Data definitions have been moved into test function body so, they will land on stack. With this fix the test works onREALTEK_RTL8195AM/ARM
.Additionally optimize the test by using templates instead of global variables.
Pull request type