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-10 (08:53)
From: Richard Jones <rich@a...>
Subject: Re: Array.init (was [Caml-list] Gripes with array)
On Fri, Sep 10, 2004 at 07:56:16AM +0200, Christophe Raffalli wrote:
> >
> >>>Also, can Array.init be made to fill the elements only once?
> >>
> >>No, that's impossible without breaking the GC invariants.
> You could also lie in the tag about the size of array (if the way the 
> runtime finds free block of memory does not use it). It will cost an 
> increment of integer at each step in the initialisation process which 
> should not be much since the beginning of array may stay in the cache if 
> the initialisation function is simple and this will be neggligeable if not.

Can one set the tag first to Custom_tag, then once array
initialization is complete, set the tag again to 0 (or
Array_double_tag as appropriate)?


Richard Jones.
Merjis Ltd. - improving website return on investment - CRM improvement consultancy