49 ms·
It fails a NULL check, where an uninitialized value (probably) won’t. That seems like a pretty important distinction, no?
by danaliv 8y ago
It fails a NULL check, where an uninitialized value (probably) won’t. That seems like a pretty important distinction, no?
- db48x 8y agoIn C, yes, that's a useful distinction. One of the goals of Rust is that you'll never have to check that manually. You'll never encounter a pointer that points to an invalid, uninitialized, or unallocated object. Since we're writing some unsafe code here, we can operate outside that restriction as long as we promise to put things right before the end of the unsafe block. This can be simplified somewhat once everything is written in Rust.