tmp/tmpwdrmqbqi/{from.md → to.md}
RENAMED
|
@@ -18,38 +18,46 @@ storage. If it is successful, it shall return the address of the start
|
|
| 18 |
of a block of storage whose length in bytes shall be at least as large
|
| 19 |
as the requested size. There are no constraints on the contents of the
|
| 20 |
allocated storage on return from the allocation function. The order,
|
| 21 |
contiguity, and initial value of storage allocated by successive calls
|
| 22 |
to an allocation function are unspecified. The pointer returned shall be
|
| 23 |
-
suitably aligned so that it can be converted to a pointer
|
| 24 |
-
complete object type
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
An allocation function that fails to allocate storage can invoke the
|
| 36 |
-
currently installed new-handler function ([[new.handler]]), if any.
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
A global allocation function is only called as the result of a new
|
| 47 |
expression ([[expr.new]]), or called directly using the function call
|
| 48 |
syntax ([[expr.call]]), or called indirectly through calls to the
|
| 49 |
-
functions in the C++standard library.
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
[[
|
|
|
|
|
|
|
| 55 |
|
|
|
|
| 18 |
of a block of storage whose length in bytes shall be at least as large
|
| 19 |
as the requested size. There are no constraints on the contents of the
|
| 20 |
allocated storage on return from the allocation function. The order,
|
| 21 |
contiguity, and initial value of storage allocated by successive calls
|
| 22 |
to an allocation function are unspecified. The pointer returned shall be
|
| 23 |
+
suitably aligned so that it can be converted to a pointer to any
|
| 24 |
+
suitable complete object type ([[new.delete.single]]) and then used to
|
| 25 |
+
access the object or array in the storage allocated (until the storage
|
| 26 |
+
is explicitly deallocated by a call to a corresponding deallocation
|
| 27 |
+
function). Even if the size of the space requested is zero, the request
|
| 28 |
+
can fail. If the request succeeds, the value returned shall be a
|
| 29 |
+
non-null pointer value ([[conv.ptr]]) `p0` different from any
|
| 30 |
+
previously returned value `p1`, unless that value `p1` was subsequently
|
| 31 |
+
passed to an `operator` `delete`. Furthermore, for the library
|
| 32 |
+
allocation functions in [[new.delete.single]] and
|
| 33 |
+
[[new.delete.array]], `p0` shall represent the address of a block of
|
| 34 |
+
storage disjoint from the storage for any other object accessible to the
|
| 35 |
+
caller. The effect of indirecting through a pointer returned as a
|
| 36 |
+
request for zero size is undefined.[^13]
|
| 37 |
|
| 38 |
An allocation function that fails to allocate storage can invoke the
|
| 39 |
+
currently installed new-handler function ([[new.handler]]), if any.
|
| 40 |
+
|
| 41 |
+
[*Note 1*: A program-supplied allocation function can obtain the
|
| 42 |
+
address of the currently installed `new_handler` using the
|
| 43 |
+
`std::get_new_handler` function ([[set.new.handler]]). — *end note*]
|
| 44 |
+
|
| 45 |
+
If an allocation function that has a non-throwing exception
|
| 46 |
+
specification ([[except.spec]]) fails to allocate storage, it shall
|
| 47 |
+
return a null pointer. Any other allocation function that fails to
|
| 48 |
+
allocate storage shall indicate failure only by throwing an exception (
|
| 49 |
+
[[except.throw]]) of a type that would match a handler (
|
| 50 |
+
[[except.handle]]) of type `std::bad_alloc` ([[bad.alloc]]).
|
| 51 |
|
| 52 |
A global allocation function is only called as the result of a new
|
| 53 |
expression ([[expr.new]]), or called directly using the function call
|
| 54 |
syntax ([[expr.call]]), or called indirectly through calls to the
|
| 55 |
+
functions in the C++standard library.
|
| 56 |
+
|
| 57 |
+
[*Note 2*: In particular, a global allocation function is not called to
|
| 58 |
+
allocate storage for objects with static storage duration (
|
| 59 |
+
[[basic.stc.static]]), for objects or references with thread storage
|
| 60 |
+
duration ([[basic.stc.thread]]), for objects of type `std::type_info` (
|
| 61 |
+
[[expr.typeid]]), or for an exception object (
|
| 62 |
+
[[except.throw]]). — *end note*]
|
| 63 |
|