diff --git a/lib/test.gi b/lib/test.gi index 88096998313..076735a38e1 100644 --- a/lib/test.gi +++ b/lib/test.gi @@ -567,14 +567,24 @@ end); ## InstallGlobalFunction( "TestDirectory", function(arg) - local basedirs, nopts, opts, files, newfiles, filetimes, - f, c, i, recurseFiles, - startTime, time, testResult, testTotal, - totalTime, STOP_TEST_CPY; + local testTotal, totalTime, totalMem, STOP_TEST_CPY, + basedirs, nopts, opts, testOptions, earlyStop, + showProgress, suppressStatusMessage, exitGAP, c, files, + filetimes, filemems, recurseFiles, f, i, startTime, + startMem, testResult, time, mem, startGcTime, gctime, + totalGcTime, filegctimes, GcTime; testTotal := true; totalTime := 0; + totalMem := 0; + totalGcTime := 0; + GcTime := function() + local g; + g := GASMAN_STATS(); + return g[1][8] + g[2][8]; + end; + STOP_TEST_CPY := STOP_TEST; STOP_TEST := function(arg) end; @@ -609,6 +619,8 @@ InstallGlobalFunction( "TestDirectory", function(arg) files := []; filetimes := []; + filemems := []; + filegctimes := []; recurseFiles := function(dirs, prefix) local dircontents, testfiles, t, testrecs, shortName, recursedirs, d, subdirs; @@ -658,6 +670,8 @@ InstallGlobalFunction( "TestDirectory", function(arg) fi; startTime := Runtime(); + startMem := TotalMemoryAllocated(); + startGcTime := GcTime(); testResult := Test(files[i].name, opts.testOptions); if not(testResult) and opts.earlyStop then STOP_TEST := STOP_TEST_CPY; @@ -673,8 +687,14 @@ InstallGlobalFunction( "TestDirectory", function(arg) testTotal := testTotal and testResult; time := Runtime() - startTime; + mem := TotalMemoryAllocated() - startMem; + gctime := GcTime() - startGcTime; filetimes[i] := time; + filemems[i] := mem; + filegctimes[i] := gctime; totalTime := totalTime + time; + totalMem := totalMem + mem; + totalGcTime := totalGcTime + gctime; if opts.showProgress then Print( String( time, 8 ), " msec (",String(gctime),"ms GC) and ", diff --git a/src/gap.c b/src/gap.c index 842c2b67495..e3ab4af4978 100644 --- a/src/gap.c +++ b/src/gap.c @@ -150,7 +150,7 @@ UInt Time; /**************************************************************************** ** -*V MemoryAllocated. . . . . . . . . . . global variable 'memory_allocated' +*V MemoryAllocated . . . . . . . . . . . global variable 'memory_allocated' ** ** 'MemoryAllocated' is the global variable 'memory_allocated', ** which is automatically assigned the amount of memory allocated while diff --git a/src/gasman.c b/src/gasman.c index 00cdd166edb..832d2a78712 100644 --- a/src/gasman.c +++ b/src/gasman.c @@ -1251,9 +1251,7 @@ UInt ResizeBag ( #ifdef COUNT_BAGS /* update the statistics */ InfoBags[type].sizeLive += new_size - old_size; - // InfoBags[type].sizeAll += new_size - old_size; #endif - // SizeAllBags += new_size - old_size; const Int diff = WORDS_BAG(new_size) - WORDS_BAG(old_size); @@ -1303,8 +1301,7 @@ UInt ResizeBag ( YoungBags += diff; AllocBags += diff; - /* In this case we increase the total amount allocated by the - difference */ + // and increase the total amount allocated by the difference #ifdef COUNT_BAGS InfoBags[type].sizeAll += new_size - old_size; #endif