]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[malloc] Ensure free memory blocks remain aligned
authorMichael Brown <mcb30@ipxe.org>
Mon, 3 Feb 2025 14:43:03 +0000 (14:43 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 3 Feb 2025 14:43:03 +0000 (14:43 +0000)
commit77cc3ed10892f65e5b01af482b5739e29614486e
tree7f264e886288173d19ba6685dd1eae6a69e95b47
parent6f076efa650f5d8cc73bc70402b23f7066943474
[malloc] Ensure free memory blocks remain aligned

When allocating memory with a non-zero alignment offset, the free
memory block structure following the allocation may end up improperly
aligned.

Ensure that free memory blocks always remain aligned to the size of
the free memory block structure.

Ensure that the initial heap is also correctly aligned, thereby
allowing the logic for leaking undersized free memory blocks to be
omitted.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/malloc.c
src/include/ipxe/malloc.h