[m-dev.] Large MR_join_and_continue() macros in runtime.

Paul Bone pbone at csse.unimelb.edu.au
Mon Nov 23 13:59:25 AEDT 2009

On Sat, Nov 21, 2009 at 07:49:10AM +1100, Zoltan Somogyi wrote:
> On 18-Nov-2009, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > I've found myself modifying and maintaining the large MR_join_and_continue()
> > macros in the runtime.  The C preprocessor language is very clumsy, and I'd
> > rather write these as native C procedures.
> As you and Peter both said, C procedures won't work, since they will lead to
> stack leaks.
> Feel free to try to make the code a Mercury procedure hand-written in C,
> but that has its own problems, since you need to arrange parameter passing
> without clobbering the values of any abstract machine registers you need.
> However, if I were you, I would keep it a macro, but give it a major cleanup,
> e.g. fix indentation, get rid of "== MR_TRUE", and use submacros defined with
> "#if ... #else ... #endif" to avoid using macros with code arguments like

I don't see a case of "== MR_TRUE" in MR_join_and_continue.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/developers/attachments/20091123/811f0fe0/attachment.sig>

More information about the developers mailing list