diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-03 09:17:33 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-04 09:37:06 +0200 |
commit | d692c62dfbf834c16ef7f171ea3161b3f3fac06b (patch) | |
tree | 470caacab92461cbf8afee32d8c9a9230ac7102a /testsuites/psxtests/psxhdrs/math/log1pl.c | |
parent | bsps/riscv: Support RTEMS_NOINIT in linkcmds (diff) | |
download | rtems-d692c62dfbf834c16ef7f171ea3161b3f3fac06b.tar.bz2 |
Make zero size allocation result consistent
The zero size allocations had no consistent behaviour in RTEMS. For
example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 )
returned in p a unique pointer (or NULL if no memory is available). In
POSIX, zero size memory allocations are implementation-defined
behaviour. The implementation has two options:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html
Linux and FreeBSD return a unique pointer for zero size memory
allocations. Use this approach for RTEMS as well throughout the memory
allocation directives
Close #4390.
Diffstat (limited to 'testsuites/psxtests/psxhdrs/math/log1pl.c')
0 files changed, 0 insertions, 0 deletions