Rounds x up to the next alignment. Assumes alignment is a power of two.
| 150 | |
| 151 | // Rounds x up to the next alignment. Assumes alignment is a power of two. |
| 152 | uint32_t align(uint32_t x, uint32_t alignment) { |
| 153 | return (x + alignment - 1) & ~(alignment - 1); |
| 154 | } |
| 155 | |
| 156 | // Returns base alignment of struct member. If |roundUp| is true, also |
| 157 | // ensure that structs, arrays, and matrices are aligned at least to a |
no outgoing calls
no test coverage detected