4 ms·
re #1 - to be fair, even if you have to use `unsafe`, it's not that bad [1]: unsafe struct FixedBufferExample { public fixed int _buffer[1024]; // This is a
by e-master 5y ago
re #1 - to be fair, even if you have to use `unsafe`, it's not that bad [1]:
unsafe struct FixedBufferExample
{
public fixed int _buffer[1024]; // This is a fixed buffer.
}
Sure, you need to be careful, but given that you'd be doing systems programming anyway, you probably would prefer to have explicit control over bounds checking, since the compiler/JIT is (unfortunately) not sophisticated enough yet to elide bounds checking in many cases.
[1] https://thedeveloperblog.com/fixed-buffer https://thedeveloperblog.com/fixed-buffer