Remove obsolete (incorrect) assertions.

This regression was introduced by
88fef7ceda (Refactor huge_*() calls into
arena internals.), and went undetected because of the --enable-debug
regression.
This commit is contained in:
Jason Evans 2015-02-15 20:13:28 -08:00
parent 02e5dcf39d
commit cb9b44914e
2 changed files with 24 additions and 23 deletions

View File

@ -983,7 +983,6 @@ arena_malloc(tsd_t *tsd, arena_t *arena, size_t size, bool zero,
{ {
assert(size != 0); assert(size != 0);
assert(size <= arena_maxclass);
arena = arena_choose(tsd, arena); arena = arena_choose(tsd, arena);
if (unlikely(arena == NULL)) if (unlikely(arena == NULL))
@ -1031,7 +1030,6 @@ arena_salloc(const void *ptr, bool demote)
index_t binind; index_t binind;
assert(ptr != NULL); assert(ptr != NULL);
assert(CHUNK_ADDR2BASE(ptr) != ptr);
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (likely(chunk != ptr)) { if (likely(chunk != ptr)) {

View File

@ -2,14 +2,16 @@
#define CHUNK 0x400000 #define CHUNK 0x400000
#define MAXALIGN (((size_t)1) << 25) #define MAXALIGN (((size_t)1) << 25)
#define MAXSZ (((size_t)1) << 26)
#define NITER 4 #define NITER 4
TEST_BEGIN(test_basic) TEST_BEGIN(test_basic)
{ {
size_t nsz, rsz, sz; size_t sz;
void *p;
sz = 42; for (sz = 1; sz < MAXSZ; sz = nallocx(sz, 0) + 1) {
size_t nsz, rsz;
void *p;
nsz = nallocx(sz, 0); nsz = nallocx(sz, 0);
assert_zu_ne(nsz, 0, "Unexpected nallocx() error"); assert_zu_ne(nsz, 0, "Unexpected nallocx() error");
p = mallocx(sz, 0); p = mallocx(sz, 0);
@ -30,6 +32,7 @@ TEST_BEGIN(test_basic)
rsz = sallocx(p, 0); rsz = sallocx(p, 0);
assert_zu_eq(nsz, rsz, "nallocx()/sallocx() rsize mismatch"); assert_zu_eq(nsz, rsz, "nallocx()/sallocx() rsize mismatch");
dallocx(p, 0); dallocx(p, 0);
}
} }
TEST_END TEST_END