Browse thread
[Caml-list] Gripes with array
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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)? Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment http://www.winwinsales.co.uk/ - CRM improvement consultancy