From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16678; Thu, 9 Sep 2004 11:37:52 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA17696 for ; Thu, 9 Sep 2004 11:37:51 +0200 (MET DST) Received: from [128.93.8.158] (macaque.inria.fr [128.93.8.158]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i899bpEf004013 for ; Thu, 9 Sep 2004 11:37:51 +0200 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <200409090310.29295.jon@jdh30.plus.com> References: <200409090310.29295.jon@jdh30.plus.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Gripes with array Date: Thu, 9 Sep 2004 11:37:50 +0200 To: caml users X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 4140246F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 non-float:01 invariants:01 inlined:01 pointers:01 filliatre:01 bigarrays:01 arrays:01 arrays:01 htmlman:01 -bit:01 ocaml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sep 9, 2004, at 04:10, Jon Harrop wrote: > I'm increasingly finding the outrageously finite size limit of arrays > to be a > pain. How I would like to get rid of that limit! > Am I right in thinking that the maximum > non-float array size on a 64-bit machine is 18,014,398,509,481,983? That's correct. It's a good thing that 32-bitters are on their way out. > Also, can Array.init be made to fill the elements only once? No, that's impossible without breaking the GC invariants. > This would make quite a few things twice as fast Twice? I doubt it very much. > Array.copy could then be written more succinctly and > efficiently in terms of Array.init as: > > let copy a = init (length a) (fun i -> a.(i)) Exactly how it's written now, except that it's inlined by hand for performance reasons. > 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. Yes, but the main use of the tag is not garbage collection. On Sep 9, 2004, at 09:17, Jean-Christophe Filliatre wrote: > 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. The last, really? On Sep 9, 2004, at 10:23, Richard Jones wrote: > 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]. Maybe you should use bigarrays instead of strings. A general remark: for more details on the internal representation of O'Caml values, you can read < http://caml.inria.fr/ocaml/htmlman/manual032.html >. -- Damien ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners