-
This is a general fix for properly initializing private copperplate heaps managed by the heapmem allocator: - the heapmem descriptor must be allocated separately, not to consume space from the heap memory. At this chance, heapmem_init() must be given the right descriptor address, not NULL. - heaps must account for the size of the meta data the allocator needs. Make sure to allocate this extra-space when no specific heap memory has been given. - upon array allocation, align the item size used in calculating the overall heap size on the next power-of-two boundary, so that the required number of items can be obtained from the pool (as the caller may rightfully assume). Without these changes, the private copperplate allocator simply cannot work on top of heapmem, so keep them grouped. Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
903b21fe