Version française
Home     About     Download     Resources     Contact us    
Browse thread
Array 4 MB size limit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: akalin@a...
Subject: Re: [Caml-list] Array 4 MB size limit
> On Friday 19 May 2006 06:57, Frederick Akalin wrote:
>> > A better idea would be to determine exactly what data structure you
>> need:
>> > which abstract operations, what performance requirements, etc.  C++
>> > and Lisp programmers tend to encode everything as arrays or lists,
>> > respectively, but quite often these are not the best data structure
>> > for the application of interest.
>>
>> I find your assertion surprising.  C++ and Common LISP are by no means
>> lacking in standard data structures (and using bare arrays is
>> discouraged in C++, as far as I know) and in my experience I haven't
>> much seen C++ code that used arrays/vectors when not appropriate.
>
> Yes, I would say that C and Fortran programmers overuse arrays because
> other
> data structures are prohibitively difficult to implement and reuse.

I would agree with you on your statement about C and Fortran.  However, I
was talking about C++, which has now grown far beyond its "C with Classes"
legacy.  C++'s standard library includes all of the most common data
structures (maps, vectors, lists), so you'd have to go out of your way to
use arrays for everything.

>> In any case, in my application (a raytracer) I am reading in lists of
>> numbers from a file representing the points of a mesh and the triangles
>> that make up the mesh (represented by a list of indices into the mesh
>> list).  A dynamically resizable, reasonable scalable array seems like
>> the best data structure to use.
>
> Why not use a list and then apply Array.of_list?

I did try that.  Then I ran up against the 4 MB limit.  Which led to my
original e-mail complaining about it here... :)

Frederick Akalin