2 ms·
I’d be interested to see such an example with a more secure language like Rust.
by baby 7y ago
I’d be interested to see such an example with a more secure language like Rust.
- pornel 7y agoThis specific case simply doesn't compile: if num > limit {} ^^^^^ expected i32, found usize The whole trick isn't really translatable to idiomatic Rust, because `malloc` is not used beyond specific C interoperability needs. If you want to store `num` elements, you use `Vec::with_capacity(num)` or such, instead of allocating the hard way.