From d1966cc085d8b7bd7ad8762f999a97f15814dc00 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 24 Apr 2015 12:12:45 +0200 Subject: [PATCH] remove dyn alloc of thr_hashrates --- ccminer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index 85e6ef1..9fa1241 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -230,7 +230,7 @@ pthread_mutex_t applog_lock; static pthread_mutex_t stats_lock; uint32_t accepted_count = 0L; uint32_t rejected_count = 0L; -static double *thr_hashrates; +static double thr_hashrates[MAX_GPUS] = { 0 }; uint64_t global_hashrate = 0; double global_diff = 0.0; uint64_t net_hashrate = 0; @@ -504,6 +504,8 @@ void proper_exit(int reason) #endif free(opt_syslog_pfx); free(opt_api_allow); + free(work_restart); + //free(thr_info); exit(reason); } @@ -2724,10 +2726,6 @@ int main(int argc, char *argv[]) if (!thr_info) return EXIT_CODE_SW_INIT_ERROR; - thr_hashrates = (double *) calloc(opt_n_threads, sizeof(double)); - if (!thr_hashrates) - return EXIT_CODE_SW_INIT_ERROR; - /* init workio thread info */ work_thr_id = opt_n_threads; thr = &thr_info[work_thr_id];