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

Code checks for NULL value returned from NEW_C_HEAP_ARRAY which can not happen

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 14
    • 14
    • hotspot
    • None
    • b16

      NEW_C_HEAP_ARRAY does not return NULL.

      in os_perf_aix.cpp and in os_perf_linux.cpp::
      _counters.cpus is checked against NULL
      cmdline is checked against NULL

      in in os_perf_solaris.cpp:
      _counters.jvmTicks is checked against NULL
      exe_path is checked against NULL

      os_perf_windows.cpp:
      query->counters is checked against NULL
      cheap_allocated_string is checked against NULL

      os_windows.cpp:
      home_path and dll_path is checked against NULL

      aotCodeHeap.cpp:
      full_name is checked against NULL

      aotLoader.cpp:
      cp is checked against NULL

      unsafe.cpp:
      utfName and class_bytes is checked against NULL

      arguments.cpp:
      default_archive_path is checked against NULL

      os.cpp:
      formatted_path, inpath and s is checked against NULL

      thread.cpp:
      new_counter is checked for NULL

      In addition many of the above involve classes declared as CHeapObj for which operator new also never returns and so NULL checks after new are also not needed.

            dholmes David Holmes
            lkorinth Leo Korinth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: