tmp/tmp6x_28awd/{from.md → to.md}
RENAMED
|
@@ -7,30 +7,29 @@ the object.
|
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
void declare_reachable(void* p);
|
| 10 |
```
|
| 11 |
|
| 12 |
-
*
|
| 13 |
-
pointer
|
| 14 |
|
| 15 |
*Effects:* If `p` is not null, the complete object referenced by `p` is
|
| 16 |
-
subsequently declared reachable
|
| 17 |
|
| 18 |
*Throws:* May throw `bad_alloc` if the system cannot allocate additional
|
| 19 |
memory that may be required to track objects declared reachable.
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
template<class T> T* undeclare_reachable(T* p);
|
| 23 |
```
|
| 24 |
|
| 25 |
-
*
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
|
| 30 |
-
*Returns:* A safely derived copy of `p` which
|
| 31 |
-
`p`.
|
| 32 |
|
| 33 |
*Throws:* Nothing.
|
| 34 |
|
| 35 |
[*Note 1*: It is expected that calls to `declare_reachable(p)` will
|
| 36 |
consume a small amount of memory in addition to that occupied by the
|
|
@@ -40,14 +39,14 @@ matched. — *end note*]
|
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
void declare_no_pointers(char* p, size_t n);
|
| 43 |
```
|
| 44 |
|
| 45 |
-
*
|
| 46 |
-
with `declare_no_pointers()`. If the specified range is in an
|
| 47 |
-
object, then it
|
| 48 |
-
object
|
| 49 |
call.
|
| 50 |
|
| 51 |
[*Note 2*: In a garbage-collecting implementation, the fact that a
|
| 52 |
region in an object is registered with `declare_no_pointers()` should
|
| 53 |
not prevent the object from being collected. — *end note*]
|
|
@@ -68,24 +67,24 @@ fails. — *end note*]
|
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
void undeclare_no_pointers(char* p, size_t n);
|
| 71 |
```
|
| 72 |
|
| 73 |
-
*
|
| 74 |
`declare_no_pointers()`.
|
| 75 |
|
| 76 |
*Effects:* Unregisters a range registered with `declare_no_pointers()`
|
| 77 |
-
for destruction. It
|
| 78 |
ends.
|
| 79 |
|
| 80 |
*Throws:* Nothing.
|
| 81 |
|
| 82 |
``` cpp
|
| 83 |
pointer_safety get_pointer_safety() noexcept;
|
| 84 |
```
|
| 85 |
|
| 86 |
*Returns:* `pointer_safety::strict` if the implementation has strict
|
| 87 |
-
pointer safety
|
| 88 |
*implementation-defined* whether `get_pointer_safety` returns
|
| 89 |
`pointer_safety::relaxed` or `pointer_safety::preferred` if the
|
| 90 |
implementation has relaxed pointer safety.[^1]
|
| 91 |
|
|
|
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
void declare_reachable(void* p);
|
| 10 |
```
|
| 11 |
|
| 12 |
+
*Preconditions:* `p` is a safely-derived
|
| 13 |
+
pointer [[basic.stc.dynamic.safety]] or a null pointer value.
|
| 14 |
|
| 15 |
*Effects:* If `p` is not null, the complete object referenced by `p` is
|
| 16 |
+
subsequently declared reachable [[basic.stc.dynamic.safety]].
|
| 17 |
|
| 18 |
*Throws:* May throw `bad_alloc` if the system cannot allocate additional
|
| 19 |
memory that may be required to track objects declared reachable.
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
template<class T> T* undeclare_reachable(T* p);
|
| 23 |
```
|
| 24 |
|
| 25 |
+
*Preconditions:* If `p` is not null, the complete object referenced by
|
| 26 |
+
`p` has been previously declared reachable, and is live [[basic.life]]
|
| 27 |
+
from the time of the call until the last `undeclare_reachable(p)` call
|
| 28 |
+
on the object.
|
| 29 |
|
| 30 |
+
*Returns:* A safely derived copy of `p` which compares equal to `p`.
|
|
|
|
| 31 |
|
| 32 |
*Throws:* Nothing.
|
| 33 |
|
| 34 |
[*Note 1*: It is expected that calls to `declare_reachable(p)` will
|
| 35 |
consume a small amount of memory in addition to that occupied by the
|
|
|
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
void declare_no_pointers(char* p, size_t n);
|
| 42 |
```
|
| 43 |
|
| 44 |
+
*Preconditions:* No bytes in the specified range are currently
|
| 45 |
+
registered with `declare_no_pointers()`. If the specified range is in an
|
| 46 |
+
allocated object, then it is entirely within a single allocated object.
|
| 47 |
+
The object is live until the corresponding `undeclare_no_pointers()`
|
| 48 |
call.
|
| 49 |
|
| 50 |
[*Note 2*: In a garbage-collecting implementation, the fact that a
|
| 51 |
region in an object is registered with `declare_no_pointers()` should
|
| 52 |
not prevent the object from being collected. — *end note*]
|
|
|
|
| 67 |
|
| 68 |
``` cpp
|
| 69 |
void undeclare_no_pointers(char* p, size_t n);
|
| 70 |
```
|
| 71 |
|
| 72 |
+
*Preconditions:* The same range has previously been passed to
|
| 73 |
`declare_no_pointers()`.
|
| 74 |
|
| 75 |
*Effects:* Unregisters a range registered with `declare_no_pointers()`
|
| 76 |
+
for destruction. It shall be called before the lifetime of the object
|
| 77 |
ends.
|
| 78 |
|
| 79 |
*Throws:* Nothing.
|
| 80 |
|
| 81 |
``` cpp
|
| 82 |
pointer_safety get_pointer_safety() noexcept;
|
| 83 |
```
|
| 84 |
|
| 85 |
*Returns:* `pointer_safety::strict` if the implementation has strict
|
| 86 |
+
pointer safety [[basic.stc.dynamic.safety]]. It is
|
| 87 |
*implementation-defined* whether `get_pointer_safety` returns
|
| 88 |
`pointer_safety::relaxed` or `pointer_safety::preferred` if the
|
| 89 |
implementation has relaxed pointer safety.[^1]
|
| 90 |
|