From 3f8bbb8c0fcb17005ab6bbe7a79a49d68209fe8b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 9 Aug 2011 20:01:33 +0200 Subject: [PATCH] bench: create separate arrays for TCP and pipe streams Size and alignment of tcp_conn_rec and pipe_conn_rec may differ so it's not safe to reuse a single array of conn_rec elements. --- test/benchmark-pound.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/benchmark-pound.c b/test/benchmark-pound.c index a53c860a..5528ab6f 100644 --- a/test/benchmark-pound.c +++ b/test/benchmark-pound.c @@ -50,15 +50,13 @@ typedef struct { static char buffer[] = "QS"; -static conn_rec conns[MAX_CONNS]; -static tcp_conn_rec* tcp_conns = (tcp_conn_rec*)conns; -static pipe_conn_rec* pipe_conns = (pipe_conn_rec*)conns; +static tcp_conn_rec tcp_conns[MAX_CONNS]; +static pipe_conn_rec pipe_conns[MAX_CONNS]; static uint64_t start_time; static uint64_t end_time; static int closed_streams; static int conns_failed; -static int concurrency; typedef void *(*setup_fn)(int num, void* arg); typedef int (*connect_fn)(int num, void* handles, void* arg); @@ -129,7 +127,7 @@ static void* tcp_do_setup(int num, void* arg) { ASSERT(r == 0); } - return conns; + return tcp_conns; } @@ -143,7 +141,7 @@ static void* pipe_do_setup(int num, void* arg) { ASSERT(r == 0); } - return conns; + return pipe_conns; }