Initialize top chunk and its size */
| 3889 | |
| 3890 | /* Initialize top chunk and its size */ |
| 3891 | static void init_top(mstate m, mchunkptr p, size_t psize) { |
| 3892 | /* Ensure alignment */ |
| 3893 | size_t offset = align_offset(chunk2mem(p)); |
| 3894 | p = (mchunkptr)((char*)p + offset); |
| 3895 | psize -= offset; |
| 3896 | |
| 3897 | m->top = p; |
| 3898 | m->topsize = psize; |
| 3899 | p->head = psize | PINUSE_BIT; |
| 3900 | /* set size of fake trailing chunk holding overhead space only once */ |
| 3901 | chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; |
| 3902 | m->trim_check = mparams.trim_threshold; /* reset on each update */ |
| 3903 | } |
| 3904 | |
| 3905 | /* Initialize bins for a new mstate that is otherwise zeroed out */ |
| 3906 | static void init_bins(mstate m) { |
no outgoing calls
no test coverage detected