diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-08-14 08:53:52 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-08-25 15:39:20 +0200 |
commit | 5a731e73c855cd96040b3ecd55ef3b65606e1eb6 (patch) | |
tree | 8267de915f6c35f10b9b5748f68d2378c6c799dc /perf | |
parent | 43e34d028115c43577713c0c3e1f0c33b0aac94a (diff) |
added ZMQ_MAKE_VALGRIND_HAPPY compile-time option
Diffstat (limited to 'perf')
-rw-r--r-- | perf/remote_thr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/perf/remote_thr.cpp b/perf/remote_thr.cpp index 1e69601..3295f2e 100644 --- a/perf/remote_thr.cpp +++ b/perf/remote_thr.cpp @@ -21,6 +21,7 @@ #include "../include/zmq_utils.h" #include <stdio.h> #include <stdlib.h> +#include <string.h> int main (int argc, char *argv []) { @@ -64,11 +65,16 @@ int main (int argc, char *argv []) } for (i = 0; i != message_count; i++) { + rc = zmq_msg_init_size (&msg, message_size); if (rc != 0) { printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno)); return -1; } +#if defined ZMQ_MAKE_VALGRIND_HAPPY + memset (zmq_msg_data (&msg), 0, message_size); +#endif + rc = zmq_send (s, &msg, 0); if (rc != 0) { printf ("error in zmq_send: %s\n", zmq_strerror (errno)); @@ -81,8 +87,6 @@ int main (int argc, char *argv []) } } - zmq_sleep (10); - rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); |