- ((size_t *)mem)[-1] = header&7 | new-mem;
- ((size_t *)new)[-2] = footer&7 | new-mem;
- ((size_t *)new)[-1] = header&7 | end-new;
- ((size_t *)end)[-2] = footer&7 | end-new;
+ /* Split the allocated chunk into two chunks. The aligned part
+ * that will be used has the size in its footer reduced by the
+ * difference between the aligned and original addresses, and
+ * the resulting size copied to its header. A new header and
+ * footer are written for the split-off part to be freed. */
+ n->psize = c->csize = C_INUSE | (new-mem);
+ n->csize = t->psize -= new-mem;