computer science//memory safety
Memory safety is the property of a program, or of the language it is written in, that its memory accesses are constrained so that it never reads or writes through invalid references or beyond the storage it is permitted to use. A language can enforce these constraints through static checks, runtime checks or restricted operations. Different mechanisms have different costs and guarantees.
Memory safety is the property of a program, or of the language it is written in, that its memory accesses are constrained so that it never reads or writes through invalid references or beyond the storage it is permitted to use. A language can enforce these constraints through static checks, runtime checks or restricted operations. Different mechanisms have different costs and guarantees.
The distinction matters because a valid algorithm can still be implemented with invalid memory accesses. Why Rust exists explains one language-level approach; security covers the broader question of what an attacker can do with a defect.