| 141 | uint64_t tell() const { return stream.tell(); } |
| 142 | |
| 143 | void alignTo(uint64_t alignment, |
| 144 | uint8_t paddingByte = Bytecode::kAlignmentByte) { |
| 145 | if (alignment < 2) |
| 146 | return; |
| 147 | uint64_t currentPos = tell(); |
| 148 | uint64_t padding = (alignment - (currentPos % alignment)) % alignment; |
| 149 | for (uint64_t i = 0; i < padding; ++i) |
| 150 | writeByte(paddingByte); |
| 151 | // Update the required alignment |
| 152 | requiredAlignment = std::max(requiredAlignment, alignment); |
| 153 | } |
| 154 | uint64_t getRequiredAlignment() const { return requiredAlignment; } |
| 155 | |
| 156 | private: |
no test coverage detected