utils: Simplify allocation implementation
Do a single allocation for both metadata and data, and align within that
allocation for the start of data. This potentially reduces heap
fragmentation, as fewer allocations of mixed size are done. It also
simplifies freeing of memory and handling of out-of-memory conditions,
as only one allocation is done.
The fake heap free implementation had to be updated to test the simpler
free path. Previously, it was always freeing memory even when passed a
null pointer. Now, we only want it to account for freed memory if a
non-null pointer is passed in.
Signed-off-by:
Jaeden Amero <jaeden.amero@arm.com>
Loading
Please register or sign in to comment