tmp/tmpmh6338f0/{from.md → to.md}
RENAMED
|
@@ -3,11 +3,12 @@
|
|
| 3 |
``` cpp
|
| 4 |
void release();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Calls `upstream_rsrc->deallocate()` as necessary to release
|
| 8 |
-
all allocated memory.
|
|
|
|
| 9 |
|
| 10 |
[*Note 1*: The memory is released back to `upstream_rsrc` even if some
|
| 11 |
blocks that were allocated from `this` have not been deallocated from
|
| 12 |
`this`. — *end note*]
|
| 13 |
|
|
@@ -19,25 +20,25 @@ memory_resource* upstream_resource() const;
|
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
void* do_allocate(size_t bytes, size_t alignment) override;
|
| 22 |
```
|
| 23 |
|
| 24 |
-
*Returns:* A pointer to allocated
|
| 25 |
-
storage [[basic.stc.dynamic.allocation]] with a size of at least
|
| 26 |
-
`bytes`. The size and alignment of the allocated memory shall meet the
|
| 27 |
-
requirements for a class derived from `memory_resource`
|
| 28 |
-
[[mem.res.class]].
|
| 29 |
-
|
| 30 |
*Effects:* If the unused space in `current_buffer` can fit a block with
|
| 31 |
the specified `bytes` and `alignment`, then allocate the return block
|
| 32 |
from `current_buffer`; otherwise set `current_buffer` to
|
| 33 |
`upstream_rsrc->allocate(n, m)`, where `n` is not less than
|
| 34 |
`max(bytes, next_buffer_size)` and `m` is not less than `alignment`, and
|
| 35 |
increase `next_buffer_size` by an *implementation-defined* growth factor
|
| 36 |
(which need not be integral), then allocate the return block from the
|
| 37 |
newly-allocated `current_buffer`.
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
*Throws:* Nothing unless `upstream_rsrc->allocate()` throws.
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
void do_deallocate(void* p, size_t bytes, size_t alignment) override;
|
| 43 |
```
|
|
|
|
| 3 |
``` cpp
|
| 4 |
void release();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Calls `upstream_rsrc->deallocate()` as necessary to release
|
| 8 |
+
all allocated memory. Resets `current_buffer` and `next_buffer_size` to
|
| 9 |
+
their initial values at construction.
|
| 10 |
|
| 11 |
[*Note 1*: The memory is released back to `upstream_rsrc` even if some
|
| 12 |
blocks that were allocated from `this` have not been deallocated from
|
| 13 |
`this`. — *end note*]
|
| 14 |
|
|
|
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
void* do_allocate(size_t bytes, size_t alignment) override;
|
| 23 |
```
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
*Effects:* If the unused space in `current_buffer` can fit a block with
|
| 26 |
the specified `bytes` and `alignment`, then allocate the return block
|
| 27 |
from `current_buffer`; otherwise set `current_buffer` to
|
| 28 |
`upstream_rsrc->allocate(n, m)`, where `n` is not less than
|
| 29 |
`max(bytes, next_buffer_size)` and `m` is not less than `alignment`, and
|
| 30 |
increase `next_buffer_size` by an *implementation-defined* growth factor
|
| 31 |
(which need not be integral), then allocate the return block from the
|
| 32 |
newly-allocated `current_buffer`.
|
| 33 |
|
| 34 |
+
*Returns:* A pointer to allocated
|
| 35 |
+
storage [[basic.stc.dynamic.allocation]] with a size of at least
|
| 36 |
+
`bytes`. The size and alignment of the allocated memory shall meet the
|
| 37 |
+
requirements for a class derived from `memory_resource`
|
| 38 |
+
[[mem.res.class]].
|
| 39 |
+
|
| 40 |
*Throws:* Nothing unless `upstream_rsrc->allocate()` throws.
|
| 41 |
|
| 42 |
``` cpp
|
| 43 |
void do_deallocate(void* p, size_t bytes, size_t alignment) override;
|
| 44 |
```
|