caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re:  Can max_array_length be enlarged?
@ 2000-05-22 18:33 Damien Doligez
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Doligez @ 2000-05-22 18:33 UTC (permalink / raw)
  To: caml-list

>From: "Dennis (Gang) Chen" <Dennis.G.Chen@motorola.com>

>In ocaml, the max length of array is determined by the predefined constant
>max_array_length. Is it possible to build an array with length
>longer than this? I noticed that this constant is defined in source
>code sys.ml by:
>
>let max_array_length = (1 lsl (word_size - 10)) - 1;;
>
>Is it safe to modify this code to set a bigger value for max_array_length?

No.  The formula really gives the maximum array size that can be
supported by the runtime and garbage collector (about 4M fields, or
16MB on a 32-bit machine).  Maybe you should have a look a the
"bigarray" library, which was designed for huge arrays (of numbers).
Or you could get a 64-bit machine, they can handle more memory than
32-bitters anyway.

-- Damien




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Can max_array_length be enlarged?
@ 2000-05-22  1:00 Dennis (Gang) Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Dennis (Gang) Chen @ 2000-05-22  1:00 UTC (permalink / raw)
  To: caml-list

Hi,

In ocaml, the max length of array is determined by the predefined constant
max_array_length. Is it possible to build an array with length
longer than this? I noticed that this constant is defined in source code sys.ml by:

let max_array_length = (1 lsl (word_size - 10)) - 1;;

Is it safe to modify this code to set a bigger value for max_array_length?

Thank you in advance for any help on this point.

--
Dennis Gang CHEN    Senior Software Engineer
Motorola Australia Software Centre, Electronic Design Automation
2 Second Avenue, Mawson Lakes, SA 5095, Australia
phone: +61 8 8203 3560,  mailto: Dennis.G.Chen@motorola.com






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-22 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-22 18:33 Can max_array_length be enlarged? Damien Doligez
  -- strict thread matches above, loose matches on Subject: below --
2000-05-22  1:00 Dennis (Gang) Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).