Re: Re: Unbound arrays


[ Follow Ups ] [ Post Followup ] [ The Fun with Ada Project ]

Posted by Matt on November 08, 19102 at 01:25:36:

In Reply to: Re: Unbound arrays posted by Preben Randhol on September 20, 19102 at 06:22:47:

Dyanmic arrays aren't any different from static arrays except that dynamic arrays are allocated on the heap and not the stack. No functional language I have ever encountered implemented an array as a linked list. That would be extremely inefficient in both space and time as compared to an array.

Certainly when I disassemble the output from my C++ compiler, I see dynamic array accesses computing pointers through offsets from the array base. Changing the length of the array requires a memory reallocate operation, not an allocate node operation. After working with JNI, I am quite sure that Java works the same way.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject: Re: Re: Re: Unbound arrays

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Fun with Ada Project ]