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.
runtime/*.[ch]:
trace/*.[chyl]:
As above. In some places, improve comments, e.g. by expanding contractions
such as "we've". Add #ifndef guards against double inclusion around
the trace/*.h files that did not already have them.
tools/*:
Make the corresponding changes in shell scripts that generate .[ch] files
in the runtime.
tests/*:
Conform to a slight change in the text of a message.
Move all .h and .c files to four-space indentation without tabs,
if they weren't there already.
Use the same vim line for all .h and .c files.
Align all backslashes at the ends of lines in macro definitions.
Align close comment signs.
In some places, fix inconsistent indentation.
Fix a bunch of comments. Add XXXs to a few of them.
Estimated hours taken: 7
Branches: main
Add support for thread-local backjumping in grades that support concurrency.
library/backjump.m:
Shift the C definition of backjump handlers and choice ids into the
runtime. This is needed because MR_Context now refers to them and
the runtime should not depend on the library.
Delete the XXX comment regarding pred_is_external/3. (This has been
fixed below.)
runtime/mercury_backjump.h:
runtime/mercury_backjump.c:
New module that defines those parts of the backjumping support that
the runtime requires access to.
In high-level C .par grades make the global state required by
backjumping thread-specific.
Conform to the usual coding conventions in the runtime in the new
versions of the data structures that were originally in backjump.m.
Rename ML_Choice_Id to MR_BackJumpChoiceId, the latter is less
ambiguous.
runtime/mercury_context.h:
runtime/mercury_context.c:
In low-level C grades add two extra fields to the MR_Context structure
to hold the global state required by backjumping.
In high-level C .par grades initialise the the thread-specific data that
is used to store the backjump global state at program startup.
Reformat a function prototype.
runtime/mercury_thread.h:
Reformat a function prototype.
runtime/Mmakefile:
Include the new files.
mdbcomp/program_representation.m:
Update pred_is_external/3 to include backjump.builtin_choice_id/1
and backjump.builtin_backjump/1.
tests/hard_coded/Mmakefile:
tests/hard_coded/tl_backjump_test.m:
tests/hard_coded/tl_backjump_test.exp:
Test thread-local backjumping.
tests/hard_coded/tl_backjump_test.exp2:
Expected output for the above test case for grades in which spawn/3
does not work.