summaryrefslogtreecommitdiffstats
path: root/spec/rtems/basedefs/req/malloclike-0.yml
blob: f5a9aab3ab7eef57b5f3ae70f36bbe741f57641f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SPDX-License-Identifier: CC-BY-SA-4.0
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
functional-type: function
links:
- role: interface-function
  uid: ../if/malloclike
rationale: |
  Functions like malloc() and calloc() have this property but functions
  like realloc() do not have this property because the memory it returns
  may pointer to valid objects.
references: []
requirement-type: functional
text: |
  When the code is compiled with the GNU C compiler,
  and the ${../if/malloclike:/name} macro is used as last part of a
  function declaration or is attached to a function definition,
  and the function returns a pointer to memory,
  and this pointer cannot be an alias of any other pointer valid when
  the function returns,
  and no pointers to valid objects occur in any storage addressed by
  that pointer,
  and the function returns non-NULL in more than 50% of the cases,
  the macro shall cause the compiler to use this information for
  optimization.
type: requirement