3 ms·
This is not memory-safety per se, but Rust goes further, though. You can't have 2 objects that can modify the same object at the same time, for instance, as in:
by sacado2 7y ago
This is not memory-safety per se, but Rust goes further, though. You can't have 2 objects that can modify the same object at the same time, for instance, as in:
l1 = [1, 2, 3];
l2 = l1;
l2.push(0); // Oops, I also modified l1, was it expected?
- deleted 7y ago[deleted]
- atilaneves 7y agoThis depends on the language. The one with GC I know best, D, would reallocate l2 when pushing to it so l1 wouldn't be modified.