Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00
Julien Fischer
abda0be991 Provide a mechanism for resetting the trail.
Estimated hours taken: 3
Branches: main

Provide a mechanism for resetting the trail.  This allows the reuse of
memory that is occupied by any entries on the trail.  This can only be done
safely after it is certain that any calls that added the trail entries
cannot be backtracked over.  For some programs doing this can prevent trail
exhaustation.

This diff does not provide a way of doing this at the Mercury level, nor
can the compiler currently automatically add calls to reclaim memory used
by trail.  Both these things are future work.

XXX the interaction between this and the debugger is a bit unclear since
trailing and debugging don't currently work together properly.

runtime/mercury_trail.h:
runtime/mercury_trail.c:
 	Add a new function MR_reset_trail().  When called this
 	function walks back along the trail calling function trail entries
 	with the MR_gc untrail reason.  It then zeros out the trail zone
 	and resets the ticket counter and ticket high water mark to their
 	initial values.

 	Define two macros, MR_TRAIL_ZONE and MR_TRAIL_BASE that expand
 	to the addresses of the trail zone and the base of the trail
 	respectively in a grade independent manner.

 	Redefine MR_num_trail_entries() using the MR_TRAIL_BASE macro.

 	Document that MR_gc is now used for this.

 	Fix a typo.

tests/trailing/Mmakefile:
tests/trailing/test_trail_reset.m:
tests/trailing/test_trail_reset.exp:
 	A test of the trail reset functionality.
2008-06-13 07:27:56 +00:00