From 354ec4309e46ef999225b3ee9578ecc024cbf9ee Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Fri, 24 Oct 2014 17:34:53 +0000
Subject: [PATCH] Track size of free ranges

---
 include/zipr_stats.h | 2 ++
 src/zipr.cpp         | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/zipr_stats.h b/include/zipr_stats.h
index 2dfb27740..9f4e1f8aa 100644
--- a/include/zipr_stats.h
+++ b/include/zipr_stats.h
@@ -18,6 +18,7 @@ class Stats_t
 			total_5byte_pins = 0;
 			total_tramp_space = 0;
 			total_other_space = 0;
+			total_free_ranges = 0;
 		};
 
 		void PrintStats(Options_t opts, std::ostream &out);
@@ -35,6 +36,7 @@ class Stats_t
 		int total_5byte_pins;
 		int total_tramp_space;
 		int total_other_space;
+		int total_free_ranges;
 
 		/*
 		 * Optimization stats tracking.
diff --git a/src/zipr.cpp b/src/zipr.cpp
index a1bc6cd39..903867e92 100644
--- a/src/zipr.cpp
+++ b/src/zipr.cpp
@@ -107,6 +107,8 @@ void Zipr_t::CreateBinaryFile(const std::string &name)
 	// go ahead and update any callback sites with the new locations 
 	UpdateCallbacks();
 
+	m_stats->total_free_ranges = free_ranges.length();
+
 	// write binary file to disk 
 	OutputBinaryFile(name);
 
-- 
GitLab