Skip to content

Track allocator and free provenance #26

Description

@itsfuad

Goal

Track allocator provenance for allocation-owning *T values and enforce correct deallocation.

Current Model

  • *T owns allocator-backed storage and moves by default.
  • rawptr is untyped, non-owning runtime address data.
  • free(owner) consumes a valid *T and lowers to deallocation.
  • Live owned values receive automatic recursive destruction at scope exit, return cleanup, overwrite, and discarded-temporary boundaries.

Progress

Remaining Work

  • Track allocation origin and allocator instance on every *T.
  • Reject deallocation through a different allocator.
  • Define allocator provenance carried by owning interface erasure (*Iface).
  • Extend validation beyond initial selected-program-allocator ABI.

Validation

  • Semantic tests for valid free, invalid operands, use after consume, and ownership joins.
  • Runtime fixtures proving exactly-once cleanup.
  • ABI tests for compatible and incompatible externally linked free declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-modelPeeper language model, ownership, pointer, optional, array/slice workownershipOwnership, move, copy, pointer-safety work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions