I see. Hm that complicates things. Idk how practical that would be, but how 
about something like this:
    
    
    type
        PMemPtr[T] = distinct int
    
    var pmemHeapStart: ByteAddress
    
    proc `[]`[T](pmemPtr: PMemPtr[T]) =
      cast[ptr T](cast[ByteAddress](pmemPtr) + pmemHeapStart)[]
    
    proc test(a: PMemPtr[SomeType]) =
      a[].field = 42
    
    
    
    Run

Reply via email to