diff options
author | Cheng Shao <terrorjack@type.dance> | 2023-03-09 12:35:48 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-25 03:46:43 -0400 |
commit | b2d14d0b8ebb517139c08934a52791f21fe893f6 (patch) | |
tree | 8fc78eddeb222f457f16a4e69d6f555350ed9694 | |
parent | 62fa7faaf8ca2d34cda3e3b7c4c6b2d13efa16fe (diff) | |
download | haskell-b2d14d0b8ebb517139c08934a52791f21fe893f6.tar.gz |
rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023
This patch does a few things:
- Add the missing RtsSymbols.c entry of performBlockingMajorGC
- Make hs_perform_gc call performBlockingMajorGC, which restores
previous behavior
- Use hs_perform_gc in ffi023
- Remove rts_clearMemory() call in ffi023, it now works again in some
test ways previously marked as broken. Fixes #23089
-rw-r--r-- | rts/HsFFI.c | 4 | ||||
-rw-r--r-- | rts/RtsSymbols.c | 1 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_run/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_run/ffi023_c.c | 3 |
4 files changed, 4 insertions, 5 deletions
diff --git a/rts/HsFFI.c b/rts/HsFFI.c index 0b9f3f0063..0b3d623302 100644 --- a/rts/HsFFI.c +++ b/rts/HsFFI.c @@ -24,8 +24,8 @@ hs_set_argv(int argc, char *argv[]) void hs_perform_gc(void) { - /* Hmmm, the FFI spec is a bit vague, but it seems to imply a major GC... */ - performMajorGC(); + /* Hmmm, the FFI spec is a bit vague, but it seems to imply a blocking major GC... */ + performBlockingMajorGC(); } // Lock the stable pointer table diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index 974f2dbd40..dee6c57f5e 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -649,6 +649,7 @@ extern char **environ; SymI_HasProto(updateRemembSetPushClosure_) \ SymI_HasProto(performGC) \ SymI_HasProto(performMajorGC) \ + SymI_HasProto(performBlockingMajorGC) \ SymI_HasProto(prog_argc) \ SymI_HasProto(prog_argv) \ SymI_HasDataProto(stg_putMVarzh) \ diff --git a/testsuite/tests/ffi/should_run/all.T b/testsuite/tests/ffi/should_run/all.T index 731943c919..7bed07bec9 100644 --- a/testsuite/tests/ffi/should_run/all.T +++ b/testsuite/tests/ffi/should_run/all.T @@ -191,7 +191,6 @@ test('T8083', [omit_ways(['ghci']), req_c], compile_and_run, ['T8083_c.c']) test('T9274', [omit_ways(['ghci'])], compile_and_run, ['']) test('ffi023', [ omit_ways(['ghci']), - expect_broken_for(23089, ['threaded2', 'nonmoving_thr', 'nonmoving_thr_sanity', 'nonmoving_thr_ghc']), extra_run_opts('1000 4'), js_broken(22363), pre_cmd('$MAKE -s --no-print-directory ffi023_setup') ], diff --git a/testsuite/tests/ffi/should_run/ffi023_c.c b/testsuite/tests/ffi/should_run/ffi023_c.c index 8928e99f9a..c5324cd97e 100644 --- a/testsuite/tests/ffi/should_run/ffi023_c.c +++ b/testsuite/tests/ffi/should_run/ffi023_c.c @@ -4,7 +4,6 @@ HsInt out (HsInt x) { - performBlockingMajorGC(); - rts_clearMemory(); + hs_perform_gc(); return incall(x); } |