[Ada] Free memory used for computing checksum (gnatmake -m)
diff mbox

Message ID 20100617130108.GA30904@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet June 17, 2010, 1:01 p.m. UTC
When gnatmake is called with switch -m, memory allocated to get the
checksum of a fie is now reclaimed, to avoid allocating too much
memory when there are many source files with time stamp mismatches.
No easy test.

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-06-17  Vincent Celier  <celier@adacore.com>

	* make.adb (Check): If switch -m is used, deallocate the memory that
	may be allocated when computing the checksum.

diff mbox

Index: make.adb
--- make.adb	(revision 160905)
+++ make.adb	(working copy)
@@ -1785,6 +1785,13 @@  package body Make is
          Modified_Source := Time_Stamp_Mismatch (ALI, Read_Only);
+         --  To avoid using too much memory when switch -m is used, free the
+         --  memory allocated for the source file when computing the checksum.
+         if Minimal_Recompilation then
+            Sinput.P.Clear_Source_File_Table;
+         end if;
          if Modified_Source /= No_File then
             ALI := No_ALI_Id;