Realtime threads with Swift

We do also want to add fixed-size arrays at some point (and there have been discussions about the best approach). Which one is "normal" depends on your perspective, but AFAIK there has been no rejection of fixed-size arrays as a concept, even if that requires a new type.

Range is a struct, so its values are stored directly. Most of the time, it will just get inlined and vanish. It is safe to use in realtime code. I would expect integer literals, as you've shown here, to compile to exactly the same code as C. For non-literals, I would expect the differences to be limited to range correctness checks (checking that lower <= upper when you write for x in lower..<upper) and integer overflow checks.

3 Likes