[m-rev.] for review: update to Boehm GC v8.0.6

Peter Wang novalazy at gmail.com
Mon Nov 29 17:32:56 AEDT 2021


Hi,

I'd like to update Boehm GC at this time, and libatomic_ops with it.
I've pushed changes to our repos:

libatomic_ops
    updated branch: release-7_6-mercury
    new tag: release-7_6-mercury-20211129

bdwgc
    new branch: release-8_0-mercury
    new tag: release-8_0-mercury-20211129

The following diff updates the Mercury repository. I haven't applied it.

The bdwgc v8.0.x branch can make use gcc/clang atomic intrinsics instead
of libatomic_ops. Unfortunately, we would still need to keep
libatomic_ops around for MSVC.

We should be able to enable munmap support by default once the upgrade
is done.

Peter

--------

commit 8bbe042d5
Author: Peter Wang <novalazy at gmail.com>
Date:   Mon Nov 29 17:28:34 2021 +1100

    Update to Boehm GC v8.2.0 and libatomic_ops v7.6.12

    boehm_gc:
        Update boehm_gc submodule to release-8.0-mercury-20201129.

    runtime/mercury_report_stats.c:
    runtime/mercury_wrapper.c:
        Use total full-collection time API added in Boehm GC v8.0.0.

    NEWS:
        Announce change.

diff --git a/NEWS b/NEWS
index 830e56619..940cbb52a 100644
--- a/NEWS
+++ b/NEWS
@@ -941,6 +941,6 @@ Changes to the Mercury implementation
   Another consequence is that the `--trail-size` and `--trail-size-kwords`
   runtime options no longer have any effect, and are deprecated.

-* We have upgraded the bundled Boehm GC to v7.6.12 and libatomic_ops to v7.6.8.
+* We have upgraded the bundled Boehm GC to v8.0.6 and libatomic_ops to v7.6.12.

 For news about earlier versions, see the HISTORY file.
Submodule boehm_gc 43ac2ea45...45e9ac4f1:
  > Update libatomic_ops submodule to v7.6.12
  > Mmakefile: Pass MAKE_AS_LIB=1 when building gc.lib
  > Ensure that /tools/if_not_there.sh uses LF endings
  > Avoid linking with user32.dll on Windows.
  > Update libatomic_ops submodule to v7.6.2
  > Add libatomoc_ops/ as a git submodule
  > Add GC_mercury_write_size_map()
  > Fix cross-compilation with thread support enabled.
  > Replace tools/if_not_there.c with shell script.
  > Add callbacks that can be used by a profiler
  > Support building in the Mercury source tree.
  > Add more files to .gitignore
  > [8.0.6]
  ... snip bdwgc changes ...

diff --git a/runtime/mercury_report_stats.c b/runtime/mercury_report_stats.c
index 3fc4923b7..9b30399c7 100644
--- a/runtime/mercury_report_stats.c
+++ b/runtime/mercury_report_stats.c
@@ -171,15 +171,19 @@ MR_report_standard_stats(FILE *fp, int *line_number)
     if (result < 0) {
         return errno;
     }
-    if (GC_mercury_calc_gc_time) {
+    {
+        unsigned long total_gc_time;
+
+        total_gc_time = GC_get_full_gc_total_time();
+        if (total_gc_time != 0) {
             // Convert from unsigned long milliseconds to float seconds.
             result = fprintf(fp, "total GC time: %.2fs, ",
-            (float) GC_total_gc_time / (float) 1000
-        );
+                (float) total_gc_time / (float) 1000);
             if (result < 0) {
                 return errno;
             }
         }
+    }
     result = fprintf(fp, "Heap used since last GC: %.3fk, Total used: %.3fk",
         GC_get_bytes_since_gc() / 1024.0,
         GC_get_heap_size() / 1024.0
diff --git a/runtime/mercury_wrapper.c b/runtime/mercury_wrapper.c
index f641ff5c5..5018d667b 100644
--- a/runtime/mercury_wrapper.c
+++ b/runtime/mercury_wrapper.c
@@ -2001,7 +2001,7 @@ MR_process_options(int argc, char **argv)

             case MR_BOEHM_GC_CALC_TIME:
 #ifdef MR_BOEHM_GC
-                GC_mercury_calc_gc_time = MR_TRUE;
+                GC_start_performance_measurement();
 #endif
                 break;


More information about the reviews mailing list