Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8217420

Let UniversalNativeInvoker andUniversalUpcallHandler create scopes for boxing code to use

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • repo-panama
    • repo-panama
    • tools

      Currently, when (un-)boxing code needs to do an allocation a Scope is created for that, and the scope is then leaked.

      For an up-/down-call there are 2 kinds of scopes; 1) for values being passed as arguments by value, which are valid for the duration of the call. 2) for values being returned, which are up to the caller to manage.

      We can do better than the current scheme of always leaking, by having UniversalUpcallHandler and UniversalNativeInvoker create both of these types of scopes, pass them to boxing code, and then close scopes of type 1) when the call is finished.

      This will reduce the amount of memory being leaked, and could also help identify bugs where references to temporary objects are leaked.

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

              Created:
              Updated:
              Resolved: