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

Function do_check_malloced_chunk

lib/dlmalloc/malloc.c:3282–3293  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3280
3281/* Check properties of malloced chunks at the point they are malloced */
3282static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
3283 if (mem != 0) {
3284 mchunkptr p = mem2chunk(mem);
3285 size_t sz = p->head & ~INUSE_BITS;
3286 do_check_inuse_chunk(m, p);
3287 assert((sz & CHUNK_ALIGN_MASK) == 0);
3288 assert(sz >= MIN_CHUNK_SIZE);
3289 assert(sz >= s);
3290 /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
3291 assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
3292 }
3293}
3294
3295/* Check a tree and its subtrees. */
3296static 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