summaryrefslogtreecommitdiff
path: root/bindings/c
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-03-09 16:56:53 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-03-09 16:56:53 +0100
commit531c6af0d4df606ddef15da821dad20399b9480a (patch)
tree168140cb9d656469e4d4f66a187f5a4dd43b5fe4 /bindings/c
parent96ccc1c5fceb56bd7ffc2e6bef9ddab5347d722b (diff)
message flags added to zmq_msg_t strcuture
Diffstat (limited to 'bindings/c')
-rw-r--r--bindings/c/zmq.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/bindings/c/zmq.h b/bindings/c/zmq.h
index 9eac38a..7d8d8ad 100644
--- a/bindings/c/zmq.h
+++ b/bindings/c/zmq.h
@@ -102,15 +102,19 @@ ZMQ_EXPORT const char *zmq_strerror (int errnum);
#define ZMQ_DELIMITER 31
#define ZMQ_VSM 32
-// A message. If 'shared' is true, message content pointed to by 'content'
-// is shared, i.e. reference counting is used to manage its lifetime
-// rather than straighforward malloc/free. Not that 'content' is not a pointer
-// to the raw data. Rather it is pointer to zmq::msg_content_t structure
+// Message flags. ZMQ_MSG_SHARED is strictly speaking not a message flag
+// (it has no equivalent in the wire format), however, making it a flag
+// allows us to pack the stucture tigher and thus improve performance.
+#define ZMQ_MSG_TBC 1
+#define ZMQ_MSG_SHARED 128
+
+// A message. Note that 'content' is not a pointer to the raw data.
+// Rather it is pointer to zmq::msg_content_t structure
// (see src/msg_content.hpp for its definition).
typedef struct
{
void *content;
- unsigned char shared;
+ unsigned char flags;
unsigned char vsm_size;
unsigned char vsm_data [ZMQ_MAX_VSM_SIZE];
} zmq_msg_t;