libroot: Adjust malloc_hoard2 to use max_align_t when available.
Spotted while investigating #18111, but likely does not fix it.
This matches the existing behavior of the runtime_loader heap.
(cherry picked from commit 5f40b96c3509d1442cd7373894c108eeed30c2ed)
Change-Id: I85a60309585ffeec8ab558b899a7782e8da5a413
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5841
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Diff
src/system/libroot/posix/malloc_hoard2/heap.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -23,6 +23,7 @@
#define _HEAP_H_
#include <OS.h>
#include <cstddef>
#include "config.h"
@@ -75,10 +76,10 @@
#endif
#ifdef __x86_64__
enum { ALIGNMENT = 16 };
#else
enum { ALIGNMENT = sizeof(double) };
#if __cplusplus >= 201103L
enum { ALIGNMENT = alignof(max_align_t) };
#else
enum { ALIGNMENT = 8 };
#endif