terminology to distinguish between languages that can / can't refer to undefined memory-Collection of common programming errors

Pointer Safety.

I apologize for not being able to attribute the original author. I know I’ve seen Erik Meijer mention and define it though.

Pointer safety (or memory safety) is the attribute of a program, or all programs in a particular language or other constraint, where the program cannot address memory other than that it explictly allocated and owns, or through an intermediary, such as OS.

Type safety is also such an attribute, but is generally stricter — if something is typesafe, it’s generally pointer-safe as well. In this attribute, memory is referred to as “objects” that have a type, and the program never manipulates that memory except through operations on that type. I’ll leave the various conflicting definitions of type alone for now, as that can also be a big question.

These attributes apply generally, and can apply to various memory management strategies — dynamic heap allocations, arena allocators, stacks, and ‘static’ or ‘global’ storage. It’s not just about heaps.

Wikipedia on pointer safety and type safety.

Originally posted 2013-11-09 23:15:17.