mirror of
https://github.com/ipxe/ipxe
synced 2026-05-16 15:00:48 +03:00
[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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user