Initialize top chunk and its size */
| 3975 | |
| 3976 | /* Initialize top chunk and its size */ |
| 3977 | static void init_top(mstate m, mchunkptr p, size_t psize) { |
| 3978 | /* Ensure alignment */ |
| 3979 | size_t offset = align_offset(chunk2mem(p)); |
| 3980 | p = (mchunkptr)((char*)p + offset); |
| 3981 | psize -= offset; |
| 3982 | |
| 3983 | m->top = p; |
| 3984 | m->topsize = psize; |
| 3985 | p->head = psize | PINUSE_BIT; |
| 3986 | /* set size of fake trailing chunk holding overhead space only once */ |
| 3987 | chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; |
| 3988 | m->trim_check = mparams.trim_threshold; /* reset on each update */ |
| 3989 | } |
| 3990 | |
| 3991 | /* Initialize bins for a new mstate that is otherwise zeroed out */ |
| 3992 | static void init_bins(mstate m) { |
no outgoing calls
no test coverage detected