mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-13 07:48:30 +00:00
size, you can do this one liner: let aligned_size = ((unasigned_size + alignment_quanta - 1) / (alignment_quanta)) * alignment_quanta; before i was doing this with a `let mut` + `if` statement. this is not as obvious but more compact, probably you'll start to see this idiom more and more in the code. I think it's also computationally efficient, because as long as the alignment_quanta is a power of 2, the compiler does something like a shift right with the `/` operator (and it may also do something like a shift left with the `*` operator as well). |
||
|---|---|---|
| .. | ||
| chat | ||
| cos_table | ||
| cramium-hal | ||
| mass-storage | ||
| perflib | ||
| tls | ||
| userprefs | ||
| xous-pio | ||
| xous-pl230 | ||