> That's false, isn't it? C# is a memory safe language, period. It relies on GC for that.
Ah, that is also false. A GC makes a language safer, but it does not protect against race conditions, so it is not entirely memory safe.
Of course, many languages that are referred to as memory safe have this loophole, but that may also be due to there not previously being a concurrent language with suitable protection in this area.
I think people refer to memory safe in general as "not being able to override memory that is not currently owned by a referred object in the program" - which certainly applies to all GCed languages.
It's definitely true that this does not imply thread-safe, and the ability to prevent the mess up the consistency of valid objects.
> I think people refer to memory safe in general as "not being able to override memory that is not currently owned by a referred object in the program" - which certainly applies to all GCed languages.
This is absolutely false. Race conditions in native structures can very easily invalidate any memory safety guarantees provided by the language, causing issues such as buffer overflows.
In other words, the presence of any memory unsafe operation leads to a total and immediate loss of all memory safety.
The former has a detailed explanation, the latter has a code example that shows more clearly what the technique can be used to do (cast a struct A to unrelated struct B with different length, thus allowing out-of-bounds reads/writes).
If on the other hand you were just saying that these languages are just called memory safe, even though they aren't, then yes. That's what I said.
Ah, that is also false. A GC makes a language safer, but it does not protect against race conditions, so it is not entirely memory safe.
Of course, many languages that are referred to as memory safe have this loophole, but that may also be due to there not previously being a concurrent language with suitable protection in this area.