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>
Fri, 17 May 2019 17:00:40 +0000 (13:00 -0400)
rts/sm/Sanity.c

index 7fc2b3b..5f02c1a 100644 (file)
@@ -1053,6 +1053,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++) {