MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / do_check_malloced_chunk

Function do_check_malloced_chunk

dlmalloc/dlmalloc.c:2670–2681  ·  view source on GitHub ↗

Check properties of malloced chunks at the point they are malloced */

Source from the content-addressed store, hash-verified

2668
2669/* Check properties of malloced chunks at the point they are malloced */
2670static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
2671 if (mem != 0) {
2672 mchunkptr p = mem2chunk(mem);
2673 size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
2674 do_check_inuse_chunk(m, p);
2675 assert((sz & CHUNK_ALIGN_MASK) == 0);
2676 assert(sz >= MIN_CHUNK_SIZE);
2677 assert(sz >= s);
2678 /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
2679 assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
2680 }
2681}
2682
2683/* Check a tree and its subtrees. */
2684static void do_check_tree(mstate m, tchunkptr t) {

Callers

nothing calls this directly

Calls 1

do_check_inuse_chunkFunction · 0.85

Tested by

no test coverage detected