Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
8e45a89895 Use spaces, not tabs, in the Java and C# runtimes.
Add modelines to keep it that way.

Fix formatting, and english in comments.
2018-07-10 13:52:11 +02:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Peter Wang
43052bb247 Add a new calling convention for Mercury procedures exported to Java with
Branches: main

Add a new calling convention for Mercury procedures exported to Java with
`:- pragma foreign_export'.  When the procedure has multiple output arguments,
require the caller to pass instances of a `Ref<T>' class which contain a field
to hold the output value.  This is more verbose than returning an `Object[]'
array, and requires extra memory allocations, but is more type-safe.  Another
advantage is that the Ref arguments will appear at the same positions as the
output arguments in the Mercury procedure.

The new convention must be enabled with `--java-export-ref-out'.  The plan is
to enable it by default in the future.

compiler/options.m:
doc/reference_manual.texi:
        Add the option.

compiler/ml_proc_gen.m:
        When the option is set, disable `--det-copy-out' and generate the
        function parameters assuming pass-by-reference for outputs.
        Only use the new convention when necessary.

compiler/mlds_to_java.m:
        Make the code to generate the exported forwarding methods account for
        `mlds_ptr_type' parameters.  These are converted to `Ref<T>' arguments.

java/runtime/Ref.java:
        Add the reference class.
2009-11-30 00:31:56 +00:00