From: David Sarrut Date: Fri, 10 Mar 2017 12:13:40 +0000 (+0100) Subject: change int to size_t X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4b107ba6fbea5265930cdd750f03a0ea6a47aba5;p=clitk.git change int to size_t --- diff --git a/common/clitkMemoryUsage.cxx b/common/clitkMemoryUsage.cxx index c95c285..a8be21a 100644 --- a/common/clitkMemoryUsage.cxx +++ b/common/clitkMemoryUsage.cxx @@ -1,7 +1,7 @@ /*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Authors belong to: + Authors belong to: - University of LYON http://www.universite-lyon.fr/ - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr @@ -23,7 +23,7 @@ # include #endif -void clitk::PrintMemory(bool verbose, std::string s) +void clitk::PrintMemory(bool verbose, std::string s) { #if CLITK_MEMORY_INFO == 1 if (verbose) { @@ -38,21 +38,20 @@ void clitk::PrintMemory(bool verbose, std::string s) #endif } -double clitk::GetMemoryUsageInMb() +double clitk::GetMemoryUsageInMb() { #if CLITK_MEMORY_INFO == 1 //sleep(1); // wait to refresh memory ? need to let the system refresh the mem - int * entries = new int; + size_t * entries = new size_t; sg_process_stats * stat = new sg_process_stats; - int i=0; + int i=0; stat = sg_get_process_stats(entries); // Search the current pid in the list of processes while (stat[i].pid != getpid()) i++; - // Display total memory size + // Display total memory size double mem = stat[i].proc_resident/1000/1000; // in MB return mem; #else return 0.0; #endif } -