Re: About array

From: Anton Moscal (
Date: Fri Oct 15 1999 - 14:30:03 MET DST

Date: Fri, 15 Oct 1999 16:30:03 +0400 (MSD)
From: Anton Moscal <>
To: Damien Doligez <>
Subject: Re: About array
In-Reply-To: <>

On Tue, 12 Oct 1999, Damien Doligez wrote:

> >From: Anton Moscal <>
> >Evaluation `f i' can cause GC call -> we must use modify function. Really
> >we can check address of our fresh array after each `f i'. While this
> >address remains unchanged we have no need to call `modify'. I think this
> >will be good.
> Wrong. There is no guarantee that the GC will move your fresh array.
> In most cases it will not because the array will already be in the
> major heap.

Oops, this is an error. But correct test can be easily written in C
(simply test address range)

> >I made the following experiment:
> [replacing Array.init with a home-brewed version]
> >time became 0.97 sec (but this version will not work
> >with float arrays)
> Indeed, it only works with int arrays. And the only reason it's

I think it will be works in the current implementation with array of any
types except float (if we replace algorithm for testing for array location
in young heap on correct version). Why not? (of course this is not correct
code from point of view of the language definition)


This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:27 MET