Nonmoving: Disable memory inventory with concurrent collection
authorBen Gamari <ben@smart-cactus.org>
Fri, 17 May 2019 02:13:02 +0000 (22:13 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 19 Jun 2019 01:40:29 +0000 (21:40 -0400)
rts/sm/Sanity.c

index 457d1f6..5796adb 100644 (file)
@@ -1048,6 +1048,14 @@ memInventory (bool show)
   W_ live_blocks = 0, free_blocks = 0;
   bool leak;
 
+#if defined(THREADED_RTS)
+  // Can't easily do a memory inventory: We might race with the nonmoving
+  // collector. In principle we could try to take nonmoving_collection_mutex
+  // and do an inventory if we have it but we don't currently implement this.
+  if (RtsFlags.GcFlags.useNonmoving)
+    return;
+#endif
+
   // count the blocks we current have
 
   for (g = 0; g < RtsFlags.GcFlags.generations; g++) {