tmp/tmpldjzr6vr/{from.md → to.md}
RENAMED
|
@@ -74,10 +74,23 @@ void operator delete(void* ptr) noexcept;
|
|
| 74 |
void operator delete(void* ptr, std::size_t size) noexcept;
|
| 75 |
void operator delete(void* ptr, std::align_val_t alignment) noexcept;
|
| 76 |
void operator delete(void* ptr, std::size_t size, std::align_val_t alignment) noexcept;
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
*Effects:* The deallocation functions [[basic.stc.dynamic.deallocation]]
|
| 80 |
called by a *delete-expression*[[expr.delete]] to render the value of
|
| 81 |
`ptr` invalid.
|
| 82 |
|
| 83 |
*Replaceable:* A C++ program may define functions with any of these
|
|
@@ -87,31 +100,14 @@ by the C++ standard library.
|
|
| 87 |
If a function without a `size` parameter is defined, the program should
|
| 88 |
also define the corresponding function with a `size` parameter. If a
|
| 89 |
function with a `size` parameter is defined, the program shall also
|
| 90 |
define the corresponding version without the `size` parameter.
|
| 91 |
|
| 92 |
-
[*Note 1*: The default behavior below
|
| 93 |
will require replacing both deallocation functions when replacing the
|
| 94 |
allocation function. — *end note*]
|
| 95 |
|
| 96 |
-
*Preconditions:* `ptr` is a null pointer or its value represents the
|
| 97 |
-
address of a block of memory allocated by an earlier call to a (possibly
|
| 98 |
-
replaced) `operator new(std::size_t)` or
|
| 99 |
-
`operator new(std::size_t, std::align_val_t)` which has not been
|
| 100 |
-
invalidated by an intervening call to `operator delete`.
|
| 101 |
-
|
| 102 |
-
*Preconditions:* If an implementation has strict pointer
|
| 103 |
-
safety [[basic.stc.dynamic.safety]] then `ptr` is a safely-derived
|
| 104 |
-
pointer.
|
| 105 |
-
|
| 106 |
-
*Preconditions:* If the `alignment` parameter is not present, `ptr` was
|
| 107 |
-
returned by an allocation function without an `alignment` parameter. If
|
| 108 |
-
present, the `alignment` argument is equal to the `alignment` argument
|
| 109 |
-
passed to the allocation function that returned `ptr`. If present, the
|
| 110 |
-
`size` argument is equal to the `size` argument passed to the allocation
|
| 111 |
-
function that returned `ptr`.
|
| 112 |
-
|
| 113 |
*Required behavior:* A call to an `operator delete` with a `size`
|
| 114 |
parameter may be changed to a call to the corresponding
|
| 115 |
`operator delete` without a `size` parameter, without affecting memory
|
| 116 |
allocation.
|
| 117 |
|
|
@@ -137,32 +133,28 @@ reclaimed storage will be allocated by subsequent calls to
|
|
| 137 |
``` cpp
|
| 138 |
void operator delete(void* ptr, const std::nothrow_t&) noexcept;
|
| 139 |
void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept;
|
| 140 |
```
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
*Effects:* The deallocation functions [[basic.stc.dynamic.deallocation]]
|
| 143 |
called by the implementation to render the value of `ptr` invalid when
|
| 144 |
the constructor invoked from a nothrow placement version of the
|
| 145 |
*new-expression* throws an exception.
|
| 146 |
|
| 147 |
*Replaceable:* A C++ program may define functions with either of these
|
| 148 |
function signatures, and thereby displace the default versions defined
|
| 149 |
by the C++ standard library.
|
| 150 |
|
| 151 |
-
*Preconditions:* `ptr` is a null pointer or its value represents the
|
| 152 |
-
address of a block of memory allocated by an earlier call to a (possibly
|
| 153 |
-
replaced) `operator new(std::size_t)` or
|
| 154 |
-
`operator new(std::size_t, std::align_val_t)` which has not been
|
| 155 |
-
invalidated by an intervening call to `operator delete`.
|
| 156 |
-
|
| 157 |
-
*Preconditions:* If an implementation has strict pointer
|
| 158 |
-
safety [[basic.stc.dynamic.safety]] then `ptr` is a safely-derived
|
| 159 |
-
pointer.
|
| 160 |
-
|
| 161 |
-
*Preconditions:* If the `alignment` parameter is not present, `ptr` was
|
| 162 |
-
returned by an allocation function without an `alignment` parameter. If
|
| 163 |
-
present, the `alignment` argument is equal to the `alignment` argument
|
| 164 |
-
passed to the allocation function that returned `ptr`.
|
| 165 |
-
|
| 166 |
*Default behavior:* Calls `operator delete(ptr)`, or
|
| 167 |
`operator delete(ptr, alignment)`, respectively.
|
| 168 |
|
|
|
|
| 74 |
void operator delete(void* ptr, std::size_t size) noexcept;
|
| 75 |
void operator delete(void* ptr, std::align_val_t alignment) noexcept;
|
| 76 |
void operator delete(void* ptr, std::size_t size, std::align_val_t alignment) noexcept;
|
| 77 |
```
|
| 78 |
|
| 79 |
+
*Preconditions:* `ptr` is a null pointer or its value represents the
|
| 80 |
+
address of a block of memory allocated by an earlier call to a (possibly
|
| 81 |
+
replaced) `operator new(std::size_t)` or
|
| 82 |
+
`operator new(std::size_t, std::align_val_t)` which has not been
|
| 83 |
+
invalidated by an intervening call to `operator delete`.
|
| 84 |
+
|
| 85 |
+
If the `alignment` parameter is not present, `ptr` was returned by an
|
| 86 |
+
allocation function without an `alignment` parameter. If present, the
|
| 87 |
+
`alignment` argument is equal to the `alignment` argument passed to the
|
| 88 |
+
allocation function that returned `ptr`. If present, the `size` argument
|
| 89 |
+
is equal to the `size` argument passed to the allocation function that
|
| 90 |
+
returned `ptr`.
|
| 91 |
+
|
| 92 |
*Effects:* The deallocation functions [[basic.stc.dynamic.deallocation]]
|
| 93 |
called by a *delete-expression*[[expr.delete]] to render the value of
|
| 94 |
`ptr` invalid.
|
| 95 |
|
| 96 |
*Replaceable:* A C++ program may define functions with any of these
|
|
|
|
| 100 |
If a function without a `size` parameter is defined, the program should
|
| 101 |
also define the corresponding function with a `size` parameter. If a
|
| 102 |
function with a `size` parameter is defined, the program shall also
|
| 103 |
define the corresponding version without the `size` parameter.
|
| 104 |
|
| 105 |
+
[*Note 1*: The default behavior below might change in the future, which
|
| 106 |
will require replacing both deallocation functions when replacing the
|
| 107 |
allocation function. — *end note*]
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
*Required behavior:* A call to an `operator delete` with a `size`
|
| 110 |
parameter may be changed to a call to the corresponding
|
| 111 |
`operator delete` without a `size` parameter, without affecting memory
|
| 112 |
allocation.
|
| 113 |
|
|
|
|
| 133 |
``` cpp
|
| 134 |
void operator delete(void* ptr, const std::nothrow_t&) noexcept;
|
| 135 |
void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept;
|
| 136 |
```
|
| 137 |
|
| 138 |
+
*Preconditions:* `ptr` is a null pointer or its value represents the
|
| 139 |
+
address of a block of memory allocated by an earlier call to a (possibly
|
| 140 |
+
replaced) `operator new(std::size_t)` or
|
| 141 |
+
`operator new(std::size_t, std::align_val_t)` which has not been
|
| 142 |
+
invalidated by an intervening call to `operator delete`.
|
| 143 |
+
|
| 144 |
+
If the `alignment` parameter is not present, `ptr` was returned by an
|
| 145 |
+
allocation function without an `alignment` parameter. If present, the
|
| 146 |
+
`alignment` argument is equal to the `alignment` argument passed to the
|
| 147 |
+
allocation function that returned `ptr`.
|
| 148 |
+
|
| 149 |
*Effects:* The deallocation functions [[basic.stc.dynamic.deallocation]]
|
| 150 |
called by the implementation to render the value of `ptr` invalid when
|
| 151 |
the constructor invoked from a nothrow placement version of the
|
| 152 |
*new-expression* throws an exception.
|
| 153 |
|
| 154 |
*Replaceable:* A C++ program may define functions with either of these
|
| 155 |
function signatures, and thereby displace the default versions defined
|
| 156 |
by the C++ standard library.
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
*Default behavior:* Calls `operator delete(ptr)`, or
|
| 159 |
`operator delete(ptr, alignment)`, respectively.
|
| 160 |
|