Initialize top chunk and its size
| 2389 | |
| 2390 | // Initialize top chunk and its size |
| 2391 | void malloc_state::init_top(mchunkptr p, size_t psize) |
| 2392 | { |
| 2393 | // Ensure alignment |
| 2394 | size_t offset = align_offset(chunk2mem(p)); |
| 2395 | p = (mchunkptr)((char*)p + offset); |
| 2396 | psize -= offset; |
| 2397 | |
| 2398 | _top = p; |
| 2399 | _topsize = psize; |
| 2400 | p->_head = psize | PINUSE_BIT; |
| 2401 | // set size of fake trailing chunk holding overhead space only once |
| 2402 | p->chunk_plus_offset(psize)->_head = top_foot_size(); |
| 2403 | _trim_check = mparams._trim_threshold; // reset on each update |
| 2404 | } |
| 2405 | |
| 2406 | // Initialize bins for a new mstate that is otherwise zeroed out |
| 2407 | void malloc_state::init_bins() |
nothing calls this directly
no test coverage detected