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

Allow max_jint array length for all element types

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21
    • hotspot
    • generic
    • generic

      Currently, according to the comment in arrayOop.hpp, arrayOopDesc::max_array_length() we need to restrict array length for some element types:

           // It should be ok to return max_jint here, but parts of the code
            // (CollectedHeap, Klass::oop_oop_iterate(), and more) uses an int for
            // passing around the size (in words) of an object. So, we need to avoid
            // overflowing an int when we add the header. See CRs 4718400 and 7110613.

      This should probably be fixed. The parts of code that use int for passing object size should use size_t or similar instead, in order to allow max_jint sized objects.

            rkennke Roman Kennke
            rkennke Roman Kennke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: