diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-05-31 09:09:43 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-06-01 11:02:35 +0200 |
commit | 58d54740785eb2c7208a01afb5bd9736e5808069 (patch) | |
tree | 19d24c817201842b3781328d5f1a5fb25138a496 /src/prefix_filter.cpp | |
parent | f84ebfdbc64b774b1f00f5b98494e66b8a88fb0b (diff) |
Assertions improved
This patch is replaces generic xs_asserts by errno_assers and
alloc_asserts as appropriate.
It is based on 0MQ patch by Martin Hurton.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/prefix_filter.cpp')
-rw-r--r-- | src/prefix_filter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/prefix_filter.cpp b/src/prefix_filter.cpp index abf68d0..b166bca 100644 --- a/src/prefix_filter.cpp +++ b/src/prefix_filter.cpp @@ -111,7 +111,7 @@ static bool pfx_add (pfx_node_t *node_, (node_->min < c ? c - node_->min : node_->min - c) + 1; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); for (unsigned short i = 0; i != node_->count; ++i) node_->next.table [i] = 0; node_->min = std::min (node_->min, c); @@ -293,7 +293,7 @@ static void pfx_rm_all (pfx_node_t *node_, void *subscribers_, node_->count = new_max - new_min + 1; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table + (new_min - node_->min), sizeof (pfx_node_t*) * node_->count); @@ -393,7 +393,7 @@ static bool pfx_rm (pfx_node_t *node_, const unsigned char *prefix_, node_->count = node_->count - (new_min - node_->min); node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table + (new_min - node_->min), sizeof (pfx_node_t*) * node_->count); @@ -417,7 +417,7 @@ static bool pfx_rm (pfx_node_t *node_, const unsigned char *prefix_, pfx_node_t **old_table = node_->next.table; node_->next.table = (pfx_node_t**) malloc (sizeof (pfx_node_t*) * node_->count); - xs_assert (node_->next.table); + alloc_assert (node_->next.table); memmove (node_->next.table, old_table, sizeof (pfx_node_t*) * node_->count); |