Knowledge (XXG)

Locks-and-keys (computing)

Source 📝

104: 38:
When a variable is deallocated, the key of its pointer is modified to hold a value different from the variable's cell. From then on, any attempt to dereference the pointer can be flagged as an error. Since copying a pointer also copies its cell value, changing the key of the ordered pair safely
30:
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 lock value. When a variable is allocated, a
35:
is created and placed both into the variable's cell and into the pointer's key cell. Every access to the pointer compares these two values, and access is allowed only if the values match.
169: 145: 82: 53: 164: 138: 131: 48: 111: 24: 103: 78: 115: 20: 158: 119: 139: 8: 146: 132: 77:(10th ed.). Pearson. p. 298. 65: 7: 100: 98: 39:disables all copies of the pointer. 118:. You can help Knowledge (XXG) by 14: 75:Concepts of Programming Languages 170:Programming language topic stubs 102: 1: 186: 97: 73:Sebesta, Robert (2012). 49:Tombstone (programming) 114:-related article is a 25:programming languages 165:Computer programming 112:programming-language 54:Multiple indirection 127: 126: 21:dangling pointers 19:is a solution to 177: 148: 141: 134: 106: 99: 89: 88: 70: 185: 184: 180: 179: 178: 176: 175: 174: 155: 154: 153: 152: 95: 93: 92: 85: 72: 71: 67: 62: 45: 12: 11: 5: 183: 181: 173: 172: 167: 157: 156: 151: 150: 143: 136: 128: 125: 124: 107: 91: 90: 83: 64: 63: 61: 58: 57: 56: 51: 44: 41: 17:Locks-and-keys 13: 10: 9: 6: 4: 3: 2: 182: 171: 168: 166: 163: 162: 160: 149: 144: 142: 137: 135: 130: 129: 123: 121: 117: 113: 108: 105: 101: 96: 86: 84:0-13-139531-9 80: 76: 69: 66: 59: 55: 52: 50: 47: 46: 42: 40: 36: 34: 28: 26: 22: 18: 120:expanding it 109: 94: 74: 68: 37: 32: 29: 23:in computer 16: 15: 159:Categories 60:References 33:lock value 43:See also 81:  110:This 116:stub 79:ISBN 161:: 27:. 147:e 140:t 133:v 122:. 87:.

Index

dangling pointers
programming languages
Tombstone (programming)
Multiple indirection
ISBN
0-13-139531-9
Stub icon
programming-language
stub
expanding it
v
t
e
Categories
Computer programming
Programming language topic stubs

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.