[malloc] Allow heap to specify block and pointer alignments

Size-tracked pointers allocated via umalloc() have historically been
aligned to a page boundary, as have the edges of the hidden memory
region covering the external heap.

Allow the block and size-tracked pointer alignments to be specified as
heap configuration parameters.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-19 16:07:27 +01:00
parent c6ca3d3af8
commit 490f1ecad8
2 changed files with 50 additions and 31 deletions
+5
View File
@@ -45,6 +45,11 @@ struct heap {
/** List of free memory blocks */
struct list_head blocks;
/** Alignment for free memory blocks */
size_t align;
/** Alignment for size-tracked allocations */
size_t ptr_align;
/** Total amount of free memory */
size_t freemem;
/** Total amount of used memory */