Check all properties of malloc_state. */
| 3448 | |
| 3449 | /* Check all properties of malloc_state. */ |
| 3450 | static void do_check_malloc_state(mstate m) { |
| 3451 | bindex_t i; |
| 3452 | size_t total; |
| 3453 | /* check bins */ |
| 3454 | for (i = 0; i < NSMALLBINS; ++i) |
| 3455 | do_check_smallbin(m, i); |
| 3456 | for (i = 0; i < NTREEBINS; ++i) |
| 3457 | do_check_treebin(m, i); |
| 3458 | |
| 3459 | if (m->dvsize != 0) { /* check dv chunk */ |
| 3460 | do_check_any_chunk(m, m->dv); |
| 3461 | assert(m->dvsize == chunksize(m->dv)); |
| 3462 | assert(m->dvsize >= MIN_CHUNK_SIZE); |
| 3463 | assert(bin_find(m, m->dv) == 0); |
| 3464 | } |
| 3465 | |
| 3466 | if (m->top != 0) { /* check top chunk */ |
| 3467 | do_check_top_chunk(m, m->top); |
| 3468 | /*assert(m->topsize == chunksize(m->top)); redundant */ |
| 3469 | assert(m->topsize > 0); |
| 3470 | assert(bin_find(m, m->top) == 0); |
| 3471 | } |
| 3472 | |
| 3473 | total = traverse_and_check(m); |
| 3474 | assert(total <= m->footprint); |
| 3475 | assert(m->footprint <= m->max_footprint); |
| 3476 | } |
| 3477 | #endif /* DEBUG */ |
| 3478 | |
| 3479 | /* ----------------------------- statistics ------------------------------ */ |
nothing calls this directly
no test coverage detected