Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
5a731e73
Commit
5a731e73
authored
Aug 14, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ZMQ_MAKE_VALGRIND_HAPPY compile-time option
parent
43e34d02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
remote_thr.cpp
perf/remote_thr.cpp
+6
-2
object.cpp
src/object.cpp
+36
-0
No files found.
perf/remote_thr.cpp
View file @
5a731e73
...
...
@@ -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
));
...
...
src/object.cpp
View file @
5a731e73
...
...
@@ -152,6 +152,9 @@ void zmq::object_t::send_stop ()
// 'stop' command goes always from administrative thread to
// the current object.
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
this
;
cmd
.
type
=
command_t
::
stop
;
ctx
->
send_command
(
slot
,
cmd
);
...
...
@@ -163,6 +166,9 @@ void zmq::object_t::send_plug (own_t *destination_, bool inc_seqnum_)
destination_
->
inc_seqnum
();
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
plug
;
send_command
(
cmd
);
...
...
@@ -172,6 +178,9 @@ void zmq::object_t::send_own (own_t *destination_, own_t *object_)
{
destination_
->
inc_seqnum
();
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
own
;
cmd
.
args
.
own
.
object
=
object_
;
...
...
@@ -185,6 +194,9 @@ void zmq::object_t::send_attach (session_t *destination_, i_engine *engine_,
destination_
->
inc_seqnum
();
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
attach
;
cmd
.
args
.
attach
.
engine
=
engine_
;
...
...
@@ -212,6 +224,9 @@ void zmq::object_t::send_bind (own_t *destination_, reader_t *in_pipe_,
destination_
->
inc_seqnum
();
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
bind
;
cmd
.
args
.
bind
.
in_pipe
=
in_pipe_
;
...
...
@@ -236,6 +251,9 @@ void zmq::object_t::send_bind (own_t *destination_, reader_t *in_pipe_,
void
zmq
::
object_t
::
send_revive
(
object_t
*
destination_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
revive
;
send_command
(
cmd
);
...
...
@@ -245,6 +263,9 @@ void zmq::object_t::send_reader_info (writer_t *destination_,
uint64_t
msgs_read_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
reader_info
;
cmd
.
args
.
reader_info
.
msgs_read
=
msgs_read_
;
...
...
@@ -254,6 +275,9 @@ void zmq::object_t::send_reader_info (writer_t *destination_,
void
zmq
::
object_t
::
send_pipe_term
(
writer_t
*
destination_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
pipe_term
;
send_command
(
cmd
);
...
...
@@ -262,6 +286,9 @@ void zmq::object_t::send_pipe_term (writer_t *destination_)
void
zmq
::
object_t
::
send_pipe_term_ack
(
reader_t
*
destination_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
pipe_term_ack
;
send_command
(
cmd
);
...
...
@@ -271,6 +298,9 @@ void zmq::object_t::send_term_req (own_t *destination_,
own_t
*
object_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
term_req
;
cmd
.
args
.
term_req
.
object
=
object_
;
...
...
@@ -280,6 +310,9 @@ void zmq::object_t::send_term_req (own_t *destination_,
void
zmq
::
object_t
::
send_term
(
own_t
*
destination_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
term
;
send_command
(
cmd
);
...
...
@@ -288,6 +321,9 @@ void zmq::object_t::send_term (own_t *destination_)
void
zmq
::
object_t
::
send_term_ack
(
own_t
*
destination_
)
{
command_t
cmd
;
#if defined ZMQ_MAKE_VALGRIND_HAPPY
memset
(
&
cmd
,
0
,
sizeof
(
cmd
));
#endif
cmd
.
destination
=
destination_
;
cmd
.
type
=
command_t
::
term_ack
;
send_command
(
cmd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment