From 61fc4d1604f206d22bc8623caceb03093cc30f38 Mon Sep 17 00:00:00 2001 From: npyl Date: Wed, 10 Jan 2018 19:46:56 +0200 Subject: [PATCH] cleanup --- src/darwin.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/darwin.cc b/src/darwin.cc index 0b6e2129d..8f5a17f8b 100644 --- a/src/darwin.cc +++ b/src/darwin.cc @@ -517,16 +517,6 @@ int update_running_processes(void) */ void get_cpu_count(void) { - /* XXX MEMORY LEAK - * - * In FreeBSD, Linux (and probably other, too) implementations exists the following bug (memory leak) - * - * info.cpu_count is allocated every time get_cpu_count() is called without checking if it was allocated again before... - * thus conky allocates only memory related to one get_cpu_count() call leaving a memory leak. - * - * Fixed by adding check to see if memory has been allocated or not. - */ - int cpu_count = 0; if (GETSYSCTL("hw.activecpu", cpu_count) == 0) { @@ -538,7 +528,7 @@ void get_cpu_count(void) /* XXX * Probably move the info.cpu_usage allocation inside the update_cpu_usage() function... - * Why is it here anyway? + * Why is it here ?? * * Unless i find some reason for keeping it here it will be moved to update_cpu_usage() * @@ -569,11 +559,9 @@ void get_cpu_count(void) /* * used by update_cpu_usage() - * - * XXX will be merged into cpusample probably */ -struct cpu_info { - /* freebsd compatibility */ +struct cpu_info +{ long oldtotal; long oldused; };