[rtems-release commit] Mention zero size allocation changes
Sebastian Huber
sebh at rtems.org
Tue May 4 11:43:58 UTC 2021
Module: rtems-release
Branch: master
Commit: f48aea09d8d82ab80568ad2edcd02b8a11bea886
Changeset: http://git.rtems.org/rtems-release/commit/?id=f48aea09d8d82ab80568ad2edcd02b8a11bea886
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue May 4 13:14:21 2021 +0200
Mention zero size allocation changes
---
rtems-notes-6.md | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/rtems-notes-6.md b/rtems-notes-6.md
index cec71d0..39ebd29 100644
--- a/rtems-notes-6.md
+++ b/rtems-notes-6.md
@@ -39,7 +39,19 @@ Implementation improvements usually fall into one of the following categories:
#### API Implementation Improvements
-* TBD
+* Zero size allocation results are now consistent accross directives, for
+ example `malloc( 0 )` and `posix_memalign( &p, align, 0 )` return now a
+ unique pointer (or `NULL` if the heap is empty). 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.
+ This approach is now also used in RTEMS as well throughout the memory
+ allocation directives
#### API Deprecations
More information about the vc
mailing list