[m-dev.] for review: don't use c_pointers as map keys in io.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 1 06:23:47 AEDT 2000


On 01-Nov-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> +:- pragma c_code(io__get_stream_id(Stream::in) = (Id::out), 
> +		will_not_call_mercury, "
> +	/* 
> +	** Most of the time, we can just use the pointer to the stream
> +	** as a unique identifier.
> +	*/
> +	
> +	Id = (MR_Word) Stream;
> +
> +#ifdef NATIVE_GC
> +	/* 
> +	** XXX for accurate GC we should embed an ID in the MercuryFile
> +	** and retrieve it here.
> +	*/
> +	MR_fatal_error(""not implemented -- stream ids in native GC grades"");
> +#endif

That change looks OK, but you realize that it will completely break
the .agc grades?  That code is called before main/2, so any program
compiled with accurate gc enabled will get that MR_fatal_error().
Previously things were broken, of course, but the symptom was not
as bad: it would just return "<stream name unknown>" or the wrong
stream name rather than the correct stream name.  Most programs
don't use that functionality, so for them it wouldn't matter.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list