summaryrefslogtreecommitdiffstats
path: root/src/jemalloc.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2015-09-17 22:27:28 (GMT)
committerJason Evans <jasone@canonware.com>2015-09-17 22:27:28 (GMT)
commit21523297fcd72128c14b40ebefbf8ccf114fbede (patch)
treeb5740c5a693e5cd9f5dac8602a296189849c00e8 /src/jemalloc.c
parent4d0e162d2db0531624edee497613c7ecb1ef212d (diff)
downloadjemalloc-21523297fcd72128c14b40ebefbf8ccf114fbede.zip
jemalloc-21523297fcd72128c14b40ebefbf8ccf114fbede.tar.gz
jemalloc-21523297fcd72128c14b40ebefbf8ccf114fbede.tar.bz2
Add mallocx() OOM tests.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r--src/jemalloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 49c5f2a..5a2d324 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1923,6 +1923,7 @@ imallocx_flags_decode_hard(tsd_t *tsd, size_t size, int flags, size_t *usize,
*alignment = MALLOCX_ALIGN_GET_SPECIFIED(flags);
*usize = sa2u(size, *alignment);
}
+ assert(*usize != 0);
*zero = MALLOCX_ZERO_GET(flags);
if ((flags & MALLOCX_TCACHE_MASK) != 0) {
if ((flags & MALLOCX_TCACHE_MASK) == MALLOCX_TCACHE_NONE)
@@ -2267,6 +2268,7 @@ ixallocx_prof(tsd_t *tsd, void *ptr, size_t old_usize, size_t size,
*/
usize_max = (alignment == 0) ? s2u(size+extra) : sa2u(size+extra,
alignment);
+ assert(usize_max != 0);
tctx = prof_alloc_prep(tsd, usize_max, prof_active, false);
if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) {
usize = ixallocx_prof_sample(ptr, old_usize, size, extra,