1 year, 3 months ago.

free() implementation not conforming to any standard?

Hi there,

I have been busy porting a project to mbed OS, but there was an irregularity which disturbs me quite profusely, because the code i am trying to port relies on standard behavior of the` free()` function. Specifically it is in C99; 7.20.3.2. There are no revisions in C11 or C++11 known to me that make an exception to the specification of `free()` in C99.

In particular, `free()` should execute deterministically by performing no operation (by not resulting in HardFaults) when being called with a NULL pointer, as to any C standard known to me.

In which way does the mbedOS implementation of free differ, and what guarantees does free() in mbedOS fulfill / not fulfill?

Thank you in advance.

Please excuse my harsh tone to the question.

posted by Christian Vorobev 03 Sep 2018

1 Answer

1 year, 3 months ago.

Hi Christian,

I'm speaking to my colleagues regarding your question, can I ask you to provide us with an example where you are experiencing the hard fault with free()?

Also, the Mbed OS implementation of free() should be the same as the C standard, where do you see the differences?

Also, I would like to point out the Mbed OS GitHub Issues page, you might find that others also have questions regarding the C standard and Mbed OS here: https://github.com/ARMmbed/mbed-os/issues

- Jenny, team Mbed