nuttx-update/arch/sim
yinshengkai d01bbaecc1 sim/heap: malloc returns a valid pointer when allocating 0 bytes.
The default heap management in nuttx returns a valid memory address when malloc(0).
In sim_heap, malloc(0) returns NULL, aligning the behavior of sim_heap with mm_heap

The man manual describes malloc as follows:
https://man7.org/linux/man-pages/man3/malloc.3.html

The malloc() function allocates size bytes and returns a pointer
to the allocated memory.  The memory is not initialized.  If size
is 0, then malloc() returns a unique pointer value that can later
be successfully passed to free().  (See "Nonportable behavior"
for portability issues.)

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-16 17:03:40 +08:00
..
include sim: fix crash caused by function recursion. 2024-10-12 11:49:18 +08:00
src sim/heap: malloc returns a valid pointer when allocating 0 bytes. 2024-10-16 17:03:40 +08:00
CMakeLists.txt cmake:fix windows build break 2024-10-01 21:34:26 +08:00
Kconfig sched/gprof: add gprof support 2024-10-10 18:46:51 +08:00