summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2013-10-21 21:56:27 (GMT)
committerJason Evans <je@fb.com>2013-10-21 21:56:27 (GMT)
commit6556e28be15d9acd8f3835fb9fad90145e1edbff (patch)
treea91c933ce691b61d1b59cfb840fb498f2e28fa44 /src
parent0135fb806e4137dc9cdf152541926a2bc95e33f0 (diff)
downloadjemalloc-6556e28be15d9acd8f3835fb9fad90145e1edbff.zip
jemalloc-6556e28be15d9acd8f3835fb9fad90145e1edbff.tar.gz
jemalloc-6556e28be15d9acd8f3835fb9fad90145e1edbff.tar.bz2
Prefer not_reached() over assert(false) where appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/jemalloc.c3
-rw-r--r--src/prof.c6
-rw-r--r--src/util.c2
-rw-r--r--src/zone.c2
4 files changed, 6 insertions, 7 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index ae56db6..5cbfc3f 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -484,8 +484,7 @@ malloc_conf_init(void)
}
break;
} default:
- /* NOTREACHED */
- assert(false);
+ not_reached();
buf[0] = '\0';
opts = buf;
}
diff --git a/src/prof.c b/src/prof.c
index c133b95..4a12d1f 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -423,7 +423,7 @@ prof_backtrace(prof_bt_t *bt, unsigned nignore)
{
cassert(config_prof);
- assert(false);
+ not_reached();
}
#endif
@@ -511,7 +511,7 @@ prof_lookup(prof_bt_t *bt)
assert(ret.v != NULL);
if (ckh_remove(&prof_tdata->bt2cnt, ret.p->ctx->bt,
NULL, NULL))
- assert(false);
+ not_reached();
ql_remove(&prof_tdata->lru_ql, ret.p, lru_link);
prof_ctx_merge(ret.p->ctx, ret.p);
/* ret can now be re-used. */
@@ -695,7 +695,7 @@ prof_ctx_destroy(prof_ctx_t *ctx)
assert(ctx->cnt_merged.accumbytes == 0);
/* Remove ctx from bt2ctx. */
if (ckh_remove(&bt2ctx, ctx->bt, NULL, NULL))
- assert(false);
+ not_reached();
prof_leave(prof_tdata);
/* Destroy ctx. */
malloc_mutex_unlock(ctx->lock);
diff --git a/src/util.c b/src/util.c
index b3a0114..679fa76 100644
--- a/src/util.c
+++ b/src/util.c
@@ -554,7 +554,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap)
f++;
break;
}
- default: not_implemented();
+ default: not_reached();
}
break;
} default: {
diff --git a/src/zone.c b/src/zone.c
index c62c183..e0302ef 100644
--- a/src/zone.c
+++ b/src/zone.c
@@ -137,7 +137,7 @@ zone_destroy(malloc_zone_t *zone)
{
/* This function should never be called. */
- assert(false);
+ not_reached();
return (NULL);
}