{
  "slug": "self-relative-pointer",
  "term": "Self-relative pointer",
  "aliases": [
    "off-holder pointer",
    "holder-relative pointer"
  ],
  "definition": "A self-relative pointer represents its target as a byte displacement from the address where the pointer value is stored.",
  "note": "Relocation: The displacement remains valid when holder and target move together with unchanged separation; moving only one endpoint requires rebasing. The off-holder design applies this representation within an NVRegion. [boost] [micro17]\n\nCopying: Copying the encoded displacement to a new holder is different from assigning the same target. In an integer example, holder 0x1000 and target 0x1080 encode +0x80. Copying that value to holder 0x1100 decodes to 0x1180; preserving target 0x1080 requires -0x80. [model]\n\nMemberwise copy: Copying a C++ struct containing a Ralloc pptr preserves the original pointee, not the corresponding member of the new struct. The native example also checks assignment and move construction; these are not deep copies or memory-image remapping. [model]\n\nNulls: A zero displacement can represent a reference to the holder itself. The offset_ptr implementation reserves displacement 1 for null instead, so its null convention is not interchangeable with other encodings. [boost]\n\nBoundary: Position independence does not establish object lifetime, compatible layout, atomic updates or durability. The integer model evaluates address arithmetic only; the separately labelled native probe exercises one pinned implementation. [model]",
  "status": "research",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-12-05",
  "related": [
    "region-id-in-value",
    "ralloc",
    "persistent-memory",
    "crash-consistency"
  ],
  "citations": [
    {
      "id": "boost",
      "title": "Boost.Interprocess 1.85. Mapping Address Independent Pointer: offset_ptr.",
      "url": "https://www.boost.org/doc/libs/1_85_0/doc/html/interprocess/offset_ptr.html",
      "accessed": "2026-12-05"
    },
    {
      "id": "micro17",
      "title": "Chen et al. Efficient Support of Position Independence on Non-Volatile Memory. MICRO 2017, sections 4-6. DOI: 10.1145/3123939.3124543.",
      "url": "https://cdn.jsdelivr.net/gh/PictureResearch/picture_papers@ad3afb3e7eb852c00a2be1ba5b6021724ff4678f/papers/micro17b.pdf",
      "accessed": "2026-12-05"
    },
    {
      "id": "model",
      "title": "Hesela. Relative-pointer relocation: integer model, native struct-copy checks and worked cases.",
      "url": "https://hesela.dev/research/relative-pointers/README.md",
      "accessed": "2026-12-05"
    }
  ],
  "provenance": [
    "Off-holder is the name used in the 2017 paper; the record groups it with the equivalent holder-relative representation, not a separate invention claim.",
    "Worked addresses are synthetic byte addresses, not C++ pointer arithmetic or a crash-recovery experiment."
  ]
}
