Close MemorySegments passed to upcalls after the upcall is done

XMLWordPrintable

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

      Currently, we don't close MemorySegments that we pass to upcalls. This makes it easier to leak a MemorySegment from an upcall, but it also incurs an additional copy on Windows and Aarch64, and forces users to close these segments manually instead.

      We can instead registers these segments with a NativeScope that is closed after the upcall completes, to make sure these segments do not leak inadvertently, and we don't need the additional copy on some platforms.

            Assignee:
            Jorn Vernee
            Reporter:
            Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: