From 4f1ccf6e62c8f4576ee87ecb30c012f84fe08882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 1 Feb 2013 15:31:15 +0100 Subject: take care of param.nodes --- lf_fifo_test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lf_fifo_test.c b/lf_fifo_test.c index 0b41aec..7d6a165 100644 --- a/lf_fifo_test.c +++ b/lf_fifo_test.c @@ -94,8 +94,12 @@ void* aggressive_push( void* param ) params = (thread_params_t*)param; fifo = params->fifo; - nodes = params->nodes = malloc( sizeof(node_t)*params->n); - if (nodes==NULL) _failure("nodes malloc failure"); + nodes = params->nodes; + if (nodes==NULL) + { + nodes = params->nodes = malloc( sizeof(node_t)*params->n); + if (nodes==NULL) _failure("nodes malloc failure"); + } for(i=0; in; i++) { @@ -186,7 +190,7 @@ static void run_aggressive_push_pop(int threads_n, int nodes_n) for(i=0; i