[m-dev.] For review: Add implementation of reference types (global heap)

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jun 10 19:22:33 AEST 1998


On 10-Jun-1998, Peter Schachte <pets at students.cs.mu.oz.au> wrote:
> > Thus, I conclude that the current interface is still too low-level
> > and implementation-specific, and thus should not be documented in its
> > current form.  In the long term, we should provide a less
> > implementation-specific interface that provides the same functionality,
> 
> How about making these functions macros instead, which include all the
> monkey business one must get up to in order to work with the heap.

That won't work -- the user might call a C function which calls
MR_make_permanent() rather than calling it directly from `pragma c_code',
in which case the relevant registers have already been clobbered
by the time you get to the macro.

> I think
> the basic interface is pretty high level, it's only the irritating transient
> register stuff that's ugly.

Yep, agreed.  But we need a solution to that before we can document it.

> Would the current code work if we just told users that these functions
> constitute calls to Mercury, and so any C code that calls them that is to be
> called from Mercury must be declared as may_call_mercury?

That might work.  I'm not sure off-hand.  Someone would need to verify this.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list