Changeset d692c62d in rtems

Timestamp:
05/03/21 07:17:33 (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
024d4ea
Parents:
eb7c33ad
git-author:
Sebastian Huber <sebastian.huber@…> (05/03/21 07:17:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/04/21 07:37:06)
Message:

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.

(No files)

Note: See TracChangeset for help on using the changeset viewer.