Gary> Does that mean the internals of arraycopy() look like this:
Gary>for (int i=0; i < num_elements; i++)
Gary> newArray[i] = oldArray[i];
No. arraycopy() is a native method but arraycopy(oldarray, 0, newarray,
0, num_elements) has the same effect has the above for-loop.
On Mon, Nov 30, 1998 at 11:08:09AM +0100, Ernst de Haan wrote:
> Chris et all,
>
>
> The Vector class uses an array. The JVM may not store the elements of
> the array in sequential memory locations, but that is not an issue. The
> programming interface is well-defined, and the internals of the
Chris et all,
Chris Sommers wrote:
>
> Folks,
> I believe that using arraycopy as shown below is not
> guaranteed to work. One cannot assume that elements of a
> Vector are stored in sequential memory locations, especially
> as the Vector changes in size and memory is allocated in a
> (possibly)
Folks,
I believe that using arraycopy as shown below is not
guaranteed to work. One cannot assume that elements of a
Vector are stored in sequential memory locations, especially
as the Vector changes in size and memory is allocated in a
(possibly) fragmented manner obver time.
- chris
Uncle Geor
Martin Sorgatz wrote:
>
> Ernst de Haan wrote:
>
> > Small performance enhancement suggested.
> >
> > The performance of java.util.Vector.copyInto(Object[]) could be
> > improved, I believe. Currently the implementation does something like:
> >
> >public void copyInto(Object[] anArray)
> >
technically we are to change only the platform dependent code - hands tied
by license. Ur improvement would not fit into that catagory :( . PLEASE
file away at javasoft.
BTW this does not mean that it wont be used, or benefit those here. I have
no problem with this being posted here
gat
Ernst de
Ernst de Haan wrote:
> Small performance enhancement suggested.
>
> The performance of java.util.Vector.copyInto(Object[]) could be
> improved, I believe. Currently the implementation does something like:
>
>public void copyInto(Object[] anArray)
>{
> int i = elementCount;
> w
Small performance enhancement suggested.
The performance of java.util.Vector.copyInto(Object[]) could be
improved, I believe. Currently the implementation does something like:
public void copyInto(Object[] anArray)
{
int i = elementCount;
while (i-- > 0)
{
anArra