[m-dev.] for review: --no-const-ground-terms

Peter Ross petdr at miscrit.be
Tue Oct 10 19:22:03 AEDT 2000


On Tue, Oct 10, 2000 at 12:31:04PM +1100, Fergus Henderson wrote:
> On 09-Oct-2000, Peter Ross <Peter.Ross at cs.kuleuven.ac.be> wrote:
> > For Fergus to review, I am not sure if it is trivial to do on the MLDS
> > backend, so any comments appreciated.
> ...
> > Add the option --const-ground-terms, which determines whether or not
> > static ground terms are output as `const'.  This option will be used to
> > avoid problem where a static ground term has one of its fields updated
> > by structure reuse.  This causes a segfault as the memory is readonly.
> 
> I think the whole idea won't work.  It's only safe to make it static
> if it's readonly.  If you'd doing destructive update on it, then it's
> not safe to make it static, because next time you try to use the static
> variable, it won't have the right value!
> 
Ahh yes, I had considered the fact that you had to do --no-common-data
so that you didn't use the same cell for two different things, but not
the fact that you will need to use the same bit of memory twice! Doh!

Pete
--------------------------------------------------------------------------
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