There is a corner cases in which the counting of allocated memory
previously was wrong: When the allocation of the chunk succeeded but the
allocation of the next struct node fails. This was relatively unlikely
to happen, as the chunk size was much bigger than the memory required by
the struct node. But it happens on the ESP32 boards resulting in failing
nightlies. This fixes the issue.
tests/malloc/main.c:123: error (preprocessorErrorDirective): Bad suppression attribute '(should'.
You can write comments in the comment after a ; or //. Valid suppression attributes; symbolName=sym
Matching on every free leads to flimsy test results where all memory
is freed but one line fails to be matched by pexpect, instead, match
the final count.
The idea is not fill the memory on the computer running a native instance and to be able to test on hardware. The test application is reworked similarly as the memarray test application. Macro are now overridable and printed at the beginnined of the test: this allows easier automatic testing
- make local functions / variables static
- adhere to the 80 column limit
- don't increment total if head could not be allocated
- allow to overwrite CHUNK_SIZE
If the memory is exhausted during the allocation of the new `head` structure, subsequent accesses to `head` will result in dereferencing of a NULL pointer.