Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Gripes with array
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-09 (08:23)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Gripes with array
On Thu, Sep 09, 2004 at 09:17:25AM +0200, Jean-Christophe Filliatre wrote:
> Jon Harrop writes:
>  > 
>  > Does anyone have any pointers to information about the origin of the size 
>  > limit for arrays? I assume it is something to do with the garbage collector 
>  > using a fixed-size tag instead of a variable-size one but I'd be interested 
>  > in the details.
> In ocaml sources, the  file byterun/mlvalues.h gives all details about
> the  block  header structure.  There  you can  see  that,  on 32  bits
> architecture,  the block size  (in words)  is stored  on 22  bits. And
> indeed Sys.max_array_length is equal to 2^22-1.
> But I must  agree with you: this is definitely too  small and we could
> imagine  that, when the  tag says  a block  is an  array, the  size is
> stored within the first (or the last) field instead.

I have a similar problem with the maximum size of strings.  In
practical terms, it limits the size of file uploads to COCANWIKI to
around 6 MB (ie., not very much) [not the full 16 MB because of
character escaping, but even 16 MB would be far too small].

Does the tag field need to be so wide?  What does the tag mean if it
has different values < No_scan_tag (251)?

Agree with the comment about us all migrating to 64 bit architectures
very soon, although I've been waiting to do this since around '92.


Richard Jones.
Merjis Ltd. - improving website return on investment
MOD_CAML lets you run type-safe Objective CAML programs inside the Apache