summaryrefslogtreecommitdiffstats
path: root/common/dummy_malloc.c
Commit message (Collapse)AuthorAgeFilesLines
* dummy_malloc: Check if sbrk() failsAndrey Smirnov2018-10-161-0/+5
| | | | | | | | Add code to check if sbrk() fails as well as setting appropriate 'errno' for users that may rely on it for error reporting. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dummy_malloc: Make use of PTR_ALIGNAndrey Smirnov2018-10-161-4/+2
| | | | | | | Drop explicit type cast and alignement code in favor of PTR_ALIGN Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* tlsf_malloc: dummy_malloc: Share code for calloc()Andrey Smirnov2018-10-161-13/+0
| | | | | | | | | | | | | Calloc() implementation for TLSF does not correctly check for malloc() failure which can result in a NULL pointer exception when trying to calloc() extra large buffers. Since both TLSF and dummy malloc implementations of calloc() are exactly the same, pick implementation for the latter (which does aforementioned check) and share it between the two. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* xfuncs: Be more informative when out of memory panic occursSascha Hauer2017-04-281-0/+4
| | | | | | | | When one of the xfuncs panics we can be a bit more informative. We can at least print the amount of bytes we wanted to allocate and how much memory we have left. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dummy malloc: Add licence headerSascha Hauer2013-03-081-0/+23
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dummy_malloc: add calloc supportJean-Christophe PLAGNIOL-VILLARD2012-01-111-0/+12
| | | | | | | needed to use menu framework Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add dummy_malloc functionsSascha Hauer2011-04-111-0/+26
For some environments the dummy malloc functions offer a very small alternative implementation. malloc will get its memory from sbrk() and never frees memory again. This of course is not suitable for interactive environments and thus depends on CONFIG_SHELL_NONE Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>