MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / do_check_top_chunk

Method do_check_top_chunk

libCacheSim/dataStructure/sparsepp/spp_dlalloc.h:1729–1741  ·  view source on GitHub ↗

Check properties of top chunk

Source from the content-addressed store, hash-verified

1727
1728// Check properties of top chunk
1729void malloc_state::do_check_top_chunk(mchunkptr p) const
1730{
1731 msegmentptr sp = segment_holding((char*)p);
1732 size_t sz = p->_head & ~INUSE_BITS; // third-lowest bit can be set!
1733 assert(sp != 0);
1734 assert((spp_is_aligned(chunk2mem(p))) || (p->_head == FENCEPOST_HEAD));
1735 assert(ok_address(p));
1736 assert(sz == _topsize);
1737 assert(sz > 0);
1738 assert(sz == ((sp->_base + sp->_size) - (char*)p) - top_foot_size());
1739 assert(p->pinuse());
1740 assert(!p->chunk_plus_offset(sz)->pinuse());
1741}
1742
1743// Check properties of (inuse) mmapped chunks
1744void malloc_state::do_check_mmapped_chunk(mchunkptr p) const

Callers

nothing calls this directly

Calls 6

assertFunction · 0.85
spp_is_alignedFunction · 0.85
chunk2memFunction · 0.85
top_foot_sizeFunction · 0.85
pinuseMethod · 0.80
chunk_plus_offsetMethod · 0.80

Tested by

no test coverage detected