about summary refs log tree commit diff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-21T13·21+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-21T13·21+0200
commit13493ef97c01a9839c340cbe4e99baae65b20e15 (patch)
treef1c769d4b2fc967265cf6ac0488dfdcd165ba502 /src/libmain/shared.cc
parent4441e4cc13ded59e1a57c3d47e7920dd6a3053fa (diff)
nix-collect-garbage: Call collectGarbage() internally
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index c83e997b2307..f300fbf1b463 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -342,4 +342,19 @@ RunPager::~RunPager()
 }
 
 
+string showBytes(unsigned long long bytes)
+{
+    return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
+}
+
+
+PrintFreed::~PrintFreed()
+{
+    if (show)
+        std::cout << format("%1% store paths deleted, %2% freed\n")
+            % results.paths.size()
+            % showBytes(results.bytesFreed);
+}
+
+
 }