Conversation

Is there a formal definition for what it means for a language to be spatially memory-safe but not temporally memory-safe? Is it something like "memory-safe under the assumption that, once freed, that memory block (whether heap or stack) will never be reused"?
11
30
Replying to and
Hmm. spatial safety: all accesses are to memory that has been allocated? temporal safety: no accesses to memory that has been deallocated? C - neither Java - both (excluding the evil low-level API)
2
Pascal without variant records or free - both; Pascal with variants & free - neither; Pascal with variant records but not free - temporal only; Pascal with free but not variant records - spatial; I fear I'm eliding (or assuming) issues with type-safety
1
Replying to and
You can have spatial without temporal memory safety: spatial memory safety is "if the current size of the object is known when it is accessed, then the access will not be out of bound". It is weaker than temporal memory safety, as it doesn't support any change.
1
If there's a change involved, then temporal memory safety is needed. Your example is temporal. Allegedly, spatial memory safety is not memory safety. Since some languages have it and tend to indicate it is sufficient (IMO it's not) it is important we have this conversation.