Initialize top chunk and its size */
| 3267 | |
| 3268 | /* Initialize top chunk and its size */ |
| 3269 | static void init_top(mstate m, mchunkptr p, size_t psize) { |
| 3270 | /* Ensure alignment */ |
| 3271 | size_t offset = align_offset(chunk2mem(p)); |
| 3272 | p = (mchunkptr)((char*)p + offset); |
| 3273 | psize -= offset; |
| 3274 | |
| 3275 | m->top = p; |
| 3276 | m->topsize = psize; |
| 3277 | p->head = psize | PINUSE_BIT; |
| 3278 | /* set size of fake trailing chunk holding overhead space only once */ |
| 3279 | chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; |
| 3280 | m->trim_check = (psize >> 2) + (psize >> 1); /* reset on each update */ |
| 3281 | if (m->trim_check > mparams.trim_threshold) |
| 3282 | m->trim_check = mparams.trim_threshold; |
| 3283 | } |
| 3284 | |
| 3285 | /* Initialize bins for a new mstate that is otherwise zeroed out */ |
| 3286 | static void init_bins(mstate m) { |
no outgoing calls
no test coverage detected