tmp/tmp0ysq3fag/{from.md → to.md}
RENAMED
|
@@ -1,26 +1,26 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
explicit monotonic_buffer_resource(memory_resource* upstream);
|
| 5 |
monotonic_buffer_resource(size_t initial_size, memory_resource* upstream);
|
| 6 |
```
|
| 7 |
|
| 8 |
-
*
|
| 9 |
-
`initial_size`, if specified,
|
| 10 |
|
| 11 |
*Effects:* Sets `upstream_rsrc` to `upstream` and `current_buffer` to
|
| 12 |
`nullptr`. If `initial_size` is specified, sets `next_buffer_size` to at
|
| 13 |
least `initial_size`; otherwise sets `next_buffer_size` to an
|
| 14 |
*implementation-defined* size.
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
monotonic_buffer_resource(void* buffer, size_t buffer_size, memory_resource* upstream);
|
| 18 |
```
|
| 19 |
|
| 20 |
-
*
|
| 21 |
-
`buffer_size`
|
| 22 |
|
| 23 |
*Effects:* Sets `upstream_rsrc` to `upstream`, `current_buffer` to
|
| 24 |
`buffer`, and `next_buffer_size` to `buffer_size` (but not less than 1),
|
| 25 |
then increases `next_buffer_size` by an *implementation-defined* growth
|
| 26 |
factor (which need not be integral).
|
|
|
|
| 1 |
+
#### Constructors and destructor <a id="mem.res.monotonic.buffer.ctor">[[mem.res.monotonic.buffer.ctor]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
explicit monotonic_buffer_resource(memory_resource* upstream);
|
| 5 |
monotonic_buffer_resource(size_t initial_size, memory_resource* upstream);
|
| 6 |
```
|
| 7 |
|
| 8 |
+
*Preconditions:* `upstream` is the address of a valid memory resource.
|
| 9 |
+
`initial_size`, if specified, is greater than zero.
|
| 10 |
|
| 11 |
*Effects:* Sets `upstream_rsrc` to `upstream` and `current_buffer` to
|
| 12 |
`nullptr`. If `initial_size` is specified, sets `next_buffer_size` to at
|
| 13 |
least `initial_size`; otherwise sets `next_buffer_size` to an
|
| 14 |
*implementation-defined* size.
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
monotonic_buffer_resource(void* buffer, size_t buffer_size, memory_resource* upstream);
|
| 18 |
```
|
| 19 |
|
| 20 |
+
*Preconditions:* `upstream` is the address of a valid memory resource.
|
| 21 |
+
`buffer_size` is no larger than the number of bytes in `buffer`.
|
| 22 |
|
| 23 |
*Effects:* Sets `upstream_rsrc` to `upstream`, `current_buffer` to
|
| 24 |
`buffer`, and `next_buffer_size` to `buffer_size` (but not less than 1),
|
| 25 |
then increases `next_buffer_size` by an *implementation-defined* growth
|
| 26 |
factor (which need not be integral).
|