MCPcopy Index your code
hub / github.com/dcodeIO/webassembly / do_check_malloc_state

Function do_check_malloc_state

lib/dlmalloc/malloc.c:3450–3476  ·  view source on GitHub ↗

Check all properties of malloc_state. */

Source from the content-addressed store, hash-verified

3448
3449/* Check all properties of malloc_state. */
3450static 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 ------------------------------ */

Callers

nothing calls this directly

Calls 6

do_check_smallbinFunction · 0.85
do_check_treebinFunction · 0.85
do_check_any_chunkFunction · 0.85
bin_findFunction · 0.85
do_check_top_chunkFunction · 0.85
traverse_and_checkFunction · 0.85

Tested by

no test coverage detected