Tags: Programming Language.
Locks-and-keys is a solution to dangling pointers in computer programming languages.The locks-and-keys approach represents pointers as ordered pairs (key address) where the key is an integer value. Heap-dynamic variables are represented as the storage for the variable plus a cell for an integer. When a variable is allocated a lock value is created and placed both into the variable’s cell and into the variable’s ordered pair.