From Jason Turner

[basic.stc.dynamic.allocation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcn92vx9a/{from.md → to.md} +12 -13
tmp/tmpcn92vx9a/{from.md → to.md} RENAMED
@@ -1,19 +1,18 @@
1
  ##### Allocation functions <a id="basic.stc.dynamic.allocation">[[basic.stc.dynamic.allocation]]</a>
2
 
3
- An allocation function shall be a class member function or a global
4
- function; a program is ill-formed if an allocation function is declared
5
- in a namespace scope other than global scope or declared static in
6
- global scope. The return type shall be `void*`. The first parameter
7
- shall have type `std::size_t` [[support.types]]. The first parameter
8
- shall not have an associated default argument [[dcl.fct.default]]. The
9
- value of the first parameter is interpreted as the requested size of the
10
- allocation. An allocation function can be a function template. Such a
11
- template shall declare its return type and first parameter as specified
12
- above (that is, template parameter types shall not be used in the return
13
- type and first parameter type). Template allocation functions shall have
14
- two or more parameters.
15
 
16
  An allocation function attempts to allocate the requested amount of
17
  storage. If it is successful, it returns the address of the start of a
18
  block of storage whose length in bytes is at least as large as the
19
  requested size. The order, contiguity, and initial value of storage
@@ -25,11 +24,11 @@ from any previously returned value `p1`, unless that value `p1` was
25
  subsequently passed to a replaceable deallocation function. Furthermore,
26
  for the library allocation functions in  [[new.delete.single]] and 
27
  [[new.delete.array]], `p0` represents the address of a block of storage
28
  disjoint from the storage for any other object accessible to the caller.
29
  The effect of indirecting through a pointer returned from a request for
30
- zero size is undefined.[^14]
31
 
32
  For an allocation function other than a reserved placement allocation
33
  function [[new.delete.placement]], the pointer returned on a successful
34
  call shall represent the address of storage that is aligned as follows:
35
 
 
1
  ##### Allocation functions <a id="basic.stc.dynamic.allocation">[[basic.stc.dynamic.allocation]]</a>
2
 
3
+ An allocation function that is not a class member function shall belong
4
+ to the global scope and not have a name with internal linkage. The
5
+ return type shall be `void*`. The first parameter shall have type
6
+ `std::size_t` [[support.types]]. The first parameter shall not have an
7
+ associated default argument [[dcl.fct.default]]. The value of the first
8
+ parameter is interpreted as the requested size of the allocation. An
9
+ allocation function can be a function template. Such a template shall
10
+ declare its return type and first parameter as specified above (that is,
11
+ template parameter types shall not be used in the return type and first
12
+ parameter type). Allocation function templates shall have two or more
13
+ parameters.
 
14
 
15
  An allocation function attempts to allocate the requested amount of
16
  storage. If it is successful, it returns the address of the start of a
17
  block of storage whose length in bytes is at least as large as the
18
  requested size. The order, contiguity, and initial value of storage
 
24
  subsequently passed to a replaceable deallocation function. Furthermore,
25
  for the library allocation functions in  [[new.delete.single]] and 
26
  [[new.delete.array]], `p0` represents the address of a block of storage
27
  disjoint from the storage for any other object accessible to the caller.
28
  The effect of indirecting through a pointer returned from a request for
29
+ zero size is undefined.[^11]
30
 
31
  For an allocation function other than a reserved placement allocation
32
  function [[new.delete.placement]], the pointer returned on a successful
33
  call shall represent the address of storage that is aligned as follows:
34