4 #include "tests/malloc.h"
5 #include "../../config.h"
9 std::align_val_t
misalign(static_cast<std::align_val_t
>(63U));
10 std::align_val_t
zeroalign(static_cast<std::align_val_t
>(0U));
11 std::align_val_t
onealign(static_cast<std::align_val_t
>(1U));
12 std::align_val_t
align(static_cast<std::align_val_t
>(64U));
13 std::align_val_t
alignx2(static_cast<std::align_val_t
>(128U));
18 for (int i
= 0 ; i
< 2 ; ++i
)
20 // Err_BadAlign alignment only
21 mem
= operator new(size
, zeroalign
, tag
);
22 operator delete(mem
, zeroalign
, tag
);
25 #if defined(HAVE_ALIGNED_ALLOC)
26 // Err_BadAlign size and alignment
27 mem
= aligned_alloc(64U, 100U);
35 mem
= aligned_alloc(64U, 0U);
44 mem
= operator new(size
, align
);
45 operator delete(mem
, size
+1, align
);
49 mem
= operator new[](size
, align
);
50 operator delete[](mem
, size
, alignx2
);