tmp/tmp8sst04wn/{from.md → to.md}
RENAMED
|
@@ -1,26 +1,25 @@
|
|
| 1 |
### Align <a id="ptr.align">[[ptr.align]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
void* align(
|
| 5 |
-
void*& ptr, std::size_t& space);
|
| 6 |
```
|
| 7 |
|
| 8 |
*Effects:* If it is possible to fit `size` bytes of storage aligned by
|
| 9 |
`alignment` into the buffer pointed to by `ptr` with length `space`, the
|
| 10 |
-
function updates `ptr` to
|
| 11 |
storage and decreases `space` by the number of bytes used for alignment.
|
| 12 |
Otherwise, the function does nothing.
|
| 13 |
|
| 14 |
*Requires:*
|
| 15 |
|
| 16 |
-
- `alignment` shall be a
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
*Returns:* A null pointer if the requested aligned buffer would not fit
|
| 21 |
into the available space, otherwise the adjusted value of `ptr`.
|
| 22 |
|
| 23 |
-
The function updates its `ptr` and `space` arguments so that
|
| 24 |
-
called repeatedly with possibly different `alignment` and
|
| 25 |
-
arguments for the same buffer.
|
| 26 |
|
|
|
|
| 1 |
### Align <a id="ptr.align">[[ptr.align]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
|
|
|
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* If it is possible to fit `size` bytes of storage aligned by
|
| 8 |
`alignment` into the buffer pointed to by `ptr` with length `space`, the
|
| 9 |
+
function updates `ptr` to represent the first possible address of such
|
| 10 |
storage and decreases `space` by the number of bytes used for alignment.
|
| 11 |
Otherwise, the function does nothing.
|
| 12 |
|
| 13 |
*Requires:*
|
| 14 |
|
| 15 |
+
- `alignment` shall be a power of two
|
| 16 |
+
- `ptr` shall represent the address of contiguous storage of at least
|
| 17 |
+
`space` bytes
|
| 18 |
|
| 19 |
*Returns:* A null pointer if the requested aligned buffer would not fit
|
| 20 |
into the available space, otherwise the adjusted value of `ptr`.
|
| 21 |
|
| 22 |
+
[*Note 1*: The function updates its `ptr` and `space` arguments so that
|
| 23 |
+
it can be called repeatedly with possibly different `alignment` and
|
| 24 |
+
`size` arguments for the same buffer. — *end note*]
|
| 25 |
|