summaryrefslogtreecommitdiff
path: root/src/zmq.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-02-22 16:23:36 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-02-22 16:23:36 +0100
commit43e8868875e1d5287979e5b9060a9b16be45cc79 (patch)
treed6df0587b107de28641b429048dff002e3c2387f /src/zmq.cpp
parent98ccff1a24a056aef15372b131eee1c1bf8f62ca (diff)
Added explicit error message in case of memory exhaustion
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/zmq.cpp')
-rw-r--r--src/zmq.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 037f6c2..01f5554 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -115,7 +115,7 @@ int zmq_msg_init_data (zmq_msg_t *msg_, void *data_, size_t size_,
zmq_free_fn *ffn_, void *hint_)
{
msg_->content = (zmq::msg_content_t*) malloc (sizeof (zmq::msg_content_t));
- zmq_assert (msg_->content);
+ alloc_assert (msg_->content);
msg_->flags = 0;
zmq::msg_content_t *content = (zmq::msg_content_t*) msg_->content;
content->data = data_;
@@ -255,7 +255,7 @@ void *zmq_init (int io_threads_)
// Create 0MQ context.
zmq::ctx_t *ctx = new (std::nothrow) zmq::ctx_t ((uint32_t) io_threads_);
- zmq_assert (ctx);
+ alloc_assert (ctx);
return (void*) ctx;
}
@@ -403,7 +403,7 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
uint64_t end = 0;
pollfd *pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd));
- zmq_assert (pollfds);
+ alloc_assert (pollfds);
// Build pollset for poll () system call.
for (int i = 0; i != nitems_; i++) {
@@ -761,7 +761,7 @@ void zmq_sleep (int seconds_)
void *zmq_stopwatch_start ()
{
uint64_t *watch = (uint64_t*) malloc (sizeof (uint64_t));
- assert (watch);
+ alloc_assert (watch);
*watch = zmq::clock_t::now_us ();
return (void*) watch;
}