From 5f91c661d6e368c7b010be3a02c1ea71ee7f5cea Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 17 Dec 2019 22:03:39 -0500 Subject: rts: Ensure that nonmoving gc isn't used with profiling --- docs/users_guide/runtime_control.rst | 4 ++-- rts/RtsFlags.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index 2fb1917d2c..738d981a18 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -372,8 +372,8 @@ performance. collections. Under this collection strategy oldest-generation garbage collection can proceed concurrently with mutation. - Note that :rts-flag:`--nonmoving-gc` cannot be used with ``-G1`` nor - :rts-flag:`-c`. + Note that :rts-flag:`-nonmoving-gc` cannot be used with ``-G1``, + :rts-flag:`profiling <-hc>` nor :rts-flag:`-c`. .. rts-flag:: -xn diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 54680b4b7f..4eac4622dd 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -1738,6 +1738,11 @@ static void normaliseRtsOpts (void) barf("The non-moving collector doesn't support -G1"); } + if (RtsFlags.ProfFlags.doHeapProfile != NO_HEAP_PROFILING && + RtsFlags.GcFlags.useNonmoving) { + barf("The non-moving collector doesn't support profiling"); + } + if (RtsFlags.GcFlags.compact && RtsFlags.GcFlags.useNonmoving) { errorBelch("The non-moving collector cannot be used in conjunction with\n" "the compacting collector."); -- cgit v1.2.1