[m-rev.] diff: fix user events seg fault

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Apr 4 14:07:49 AEST 2007


On Wed, 4 Apr 2007, Mark Brown wrote:

> Index: doc/reference_manual.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.388
> diff -u -r1.388 reference_manual.texi
> --- doc/reference_manual.texi	6 Mar 2007 04:22:38 -0000	1.388
> +++ doc/reference_manual.texi	3 Apr 2007 11:19:47 -0000
> @@ -7068,9 +7068,15 @@
> to their Mercury types, as determined by the rules specified in
> @ref{C data passing conventions}.
>
> -The C code fragment may declare local variables, but it should not
> -declare any labels or static variables unless there is also a Mercury
> - at samp{pragma no_inline} declaration for the procedure.
> +The C code fragment may declare local variables,
> +up to a total size of 10kB for the procedure.
> +If a procedure requires more than this for its local variables,
> +the code can be moved into a separate function
> +(defined in a @samp{pragma foreign_code} declaration, for example).
> +
> +The C code fragment should not declare any labels or static variables
> +unless there is also a Mercury @samp{pragma no_inline} declaration

or @samp{may_not_duplicate} foreign code attribute ...

> +for the procedure.
> The reason for this is that otherwise the Mercury implementation may
> inline the procedure by duplicating the C code fragment for each call.
> If the C code fragment declared a static variable, inlining it in this
> Index: runtime/mercury_engine.c
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.c,v
> retrieving revision 1.57
> diff -u -r1.57 mercury_engine.c
> --- runtime/mercury_engine.c	6 Mar 2007 03:35:28 -0000	1.57
> +++ runtime/mercury_engine.c	3 Apr 2007 11:24:10 -0000
> @@ -27,7 +27,12 @@
>
>   #ifdef MR_USE_GCC_NONLOCAL_GOTOS
>
> -    #define LOCALS_SIZE     10024   /* space to reserve for local vars */
> +    /*
> +    ** Space to reserve for local vars.  If this parameter is modified
> +    ** then the reference manual will also need to be updated.
> +    */
> +    #define LOCALS_SIZE     10240
> +

I suggest putting a comment in the reference manual source that points
to here as well.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list