NativeAllocationScope should have a way to register existing segments onto it

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • None
    • Affects Version/s: repo-panama
    • Component/s: tools

      In extracted code, there are two cases where segments can be created outside of an allocation scope:

      * structs passed returned by value
      * callback segments

      In these cases it is necessary for clients to manually handle the life-cycle of these segments with a separate (nested) try with resource, which makes the code harder to follow.

      Jextract is currently bypassing this limitation by providing a "register" mechanism, but the provided mechanism is not very safe, since it is up to the user not to prematurely close the registered segment.

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: