* Ensures alignment of the position in the output stream by writing * some data. * * @param alignment Alignment. Must be a power of 2. */
| 78 | * @param alignment Alignment. Must be a power of 2. |
| 79 | */ |
| 80 | void Align(size_t alignment = sizeof(void*)) { |
| 81 | Y_ASSERT(IsPowerOf2(alignment)); |
| 82 | |
| 83 | static char unused[sizeof(void*) * 2]; |
| 84 | Y_ASSERT(alignment <= sizeof(unused)); |
| 85 | |
| 86 | if (Position_ & (alignment - 1)) { |
| 87 | DoWrite(unused, alignment - (Position_ & (alignment - 1))); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | private: |
| 92 | void DoWrite(const void* ptr, size_t len) override; |
nothing calls this directly
no test coverage detected