[RTEMS Project] #4390: Make zero size allocation result consistent across directives
RTEMS trac
trac at rtems.org
Thu May 6 13:15:10 UTC 2021
#4390: Make zero size allocation result consistent across directives
-----------------------------+------------------------------
Reporter: Sebastian Huber | Owner: Sebastian Huber
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.1
Component: admin | Version: 6
Severity: normal | Resolution: fixed
Keywords: | Blocked By:
Blocking: |
-----------------------------+------------------------------
Comment (by Sebastian Huber <sebastian.huber@…>):
In [changeset:"2c5199bb049efe8e29cd12461dc57bd6e30388e8/rtems"
2c5199b/rtems]:
{{{
#!CommitTicketReference repository="rtems"
revision="2c5199bb049efe8e29cd12461dc57bd6e30388e8"
Return NULL for zero size allocations
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. Return NULL on RTEMS to more likely catch the use of a
zero size memory area by erroneous applications.
Update #4390.
}}}
--
Ticket URL: <http://devel.rtems.org/ticket/4390#comment:5>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list