encyclopegia.org

Locks-and-keys (computing)

Locks-and-keys is a solution to dangling pointers in computer programming languages.[src] The locks-and-keys approach represents pointers as ordered pairs (key, address) where the key is an integer value.[src] Heap-dynamic variables are represented as the storage for the variable plus a cell for an integer lock value.[src] When a variable is allocated, a lock value is created and placed both into the variable's cell and into the pointer's key cell.[src] Every access to the pointer compares these two values, and access is allowed only if the values match.[src] When a variable is deallocated, the key of its pointer is modified to hold a value different from the variable's cell.[src] From then on, any attempt to dereference the pointer can be flagged as an error.[src] Since copying a pointer also copies its cell value, changing the key of the ordered pair safely disables all copies of the pointer.[src]

Locks-and-keys is a solution to dangling pointers in computer programming languages.[src] The locks-and-keys approach represents pointers as ordered pairs (key, address) where the key is an integer value.[src] Heap-dynamic variables are represented as the storage for the variable plus a cell for an integer lock value.[src] When a variable is allocated, a lock value is created and placed both into the variable's cell and into the pointer's key cell.[src] Every access to the pointer compares these two values, and access is allowed only if the values match.[src] When a variable is deallocated, the key of its pointer is modified to hold a value different from the variable's cell.[src] From then on, any attempt to dereference the pointer can be flagged as an error.[src] Since copying a pointer also copies its cell value, changing the key of the ordered pair safely disables all copies of the pointer.[src] ==See also== Tombstone (programming) Multiple indirection ==References==[src]

17 sentences · 17 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Locks-and-keys (computing)." encyclopegia.org, 2024, https://encyclopegia.org/wiki/locks-and-keys-computing. Accessed 27 November 2026.

Chicago

"Locks-and-keys (computing)." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/locks-and-keys-computing.

APA

encyclopegia.org. (2024). Locks-and-keys (computing). Retrieved November 27, 2026, from https://encyclopegia.org/wiki/locks-and-keys-computing

Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Air-Gapped Computing

article · references available

Codes and Keys

stub · references available

Association for Computing Machinery

stub · references available

IEEE Transactions on Mobile Computing

stub · references available

16-bit computing

stub · references available

ACM Computing Classification System

stub · references available

timeline of computing 1990–1999

stub · references available

Distributed Computing Environment

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1260199760 · 0.5 · snapshot enwiki-001260199760

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.