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

Simplify resource_area uses in ClassPathDirEntry::open_stream

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b24
    • generic

      Currently, it's correct, but there are two places we can improve it.

      1. We should assert that current == Thread::current(). if it is not case, then we intermix NEW_RESOURCE_ARRAY_IN_THREAD(current, char, path_len) and FREE_RESOURCE_ARRAY(char, path, path_len)!

      2. We don't need to call FREE_RESOURCE_ARRAY(char, path, path_len) for path. it won't release anything because buffer stands in its way.

      thread's resource area is like this. Afree(path, path_len) won't reclaim the space.
      |path | buffer |...|
                          ^hwm



                           

            xliu Xin Liu
            xliu Xin Liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: