Check all properties of malloc_state. */
| 2835 | |
| 2836 | /* Check all properties of malloc_state. */ |
| 2837 | static void do_check_malloc_state(mstate m) { |
| 2838 | bindex_t i; |
| 2839 | size_t total; |
| 2840 | /* check bins */ |
| 2841 | for (i = 0; i < NSMALLBINS; ++i) |
| 2842 | do_check_smallbin(m, i); |
| 2843 | for (i = 0; i < NTREEBINS; ++i) |
| 2844 | do_check_treebin(m, i); |
| 2845 | |
| 2846 | if (m->dvsize != 0) { /* check dv chunk */ |
| 2847 | do_check_any_chunk(m, m->dv); |
| 2848 | assert(m->dvsize == chunksize(m->dv)); |
| 2849 | assert(m->dvsize >= MIN_CHUNK_SIZE); |
| 2850 | assert(bin_find(m, m->dv) == 0); |
| 2851 | } |
| 2852 | |
| 2853 | if (m->top != 0) { /* check top chunk */ |
| 2854 | do_check_top_chunk(m, m->top); |
| 2855 | assert(m->topsize == chunksize(m->top)); |
| 2856 | assert(m->topsize > 0); |
| 2857 | assert(bin_find(m, m->top) == 0); |
| 2858 | } |
| 2859 | |
| 2860 | total = traverse_and_check(m); |
| 2861 | assert(total <= m->footprint); |
| 2862 | assert(m->footprint <= m->max_footprint); |
| 2863 | } |
| 2864 | #endif /* DEBUG */ |
| 2865 | |
| 2866 | /* ----------------------------- statistics ------------------------------ */ |
nothing calls this directly
no test coverage detected