JDK-4148842 : Java language needs reallocation mechanism for arrays
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-06-15
  • Updated: 2000-03-08
  • Resolved: 2000-03-08
Related Reports
Relates :  
Description

Name: rm29839			Date: 06/15/98


Java language needs reallocation mechanism for arrays
like realloc function in C and GlobalRealloc in Windows.
Using this function core Java classes like Vector
can be reimplemented in more efficient way.
It can _really_ speed up all Java programs.

For example it can be just a method in System class:
public static Object reallocate (Object array, int newSize);

which can return the same object or the new one with new size.
(Review ID: 33606)
======================================================================

Comments
WORK AROUND Name: rm29839 Date: 06/15/98 None. ======================================================================
11-06-2004

EVALUATION For enlarging an array, it must a new array must be created and the old one copied, in general. Certain storage allocation schemes leave holes in the storage arena into which an existing array may sometimes be opportunistically expanded at lower cost. I don't know how applicable this is to our VM. william.maddox@Eng 1998-06-19
19-06-1998