08-02-2026, 03:45 AM
Another idea that could help in your code too: most of the time, to look for a free slot, you iterate through the elements of the arrays (.is_active), maybe the use of bit sets may help to be faster (all on a u16 if max elements <=16, u8 if <= 8...), looking for the first bit equal to 0 in a number can be faster -> no memory read
there is a cpu instructions for that (BS1F, BS1B), but not in C (but easy loop)
there is a cpu instructions for that (BS1F, BS1B), but not in C (but easy loop)

