Skip to content

Commit 5540972

Browse files
committed
Require less alignment in the default allocator unit tests
Apparently, Android does not align the result properly. This should fix #176.
1 parent e379d5f commit 5540972

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test/default_allocator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using namespace foonathan::memory;
1515

1616
// *very* simple test case to ensure proper alignment and might catch some segfaults
1717
template <class Allocator>
18-
void check_default_allocator(Allocator& alloc, std::size_t def_alignment = detail::max_alignment)
18+
void check_default_allocator(Allocator& alloc, std::size_t def_alignment = alignof(void*))
1919
{
2020
auto ptr = alloc.allocate_node(1, 1);
2121
REQUIRE(detail::is_aligned(ptr, def_alignment));
@@ -76,8 +76,8 @@ TEST_CASE("virtual_memory_allocator")
7676

7777
TEST_CASE("virtual_block_allocator")
7878
{
79-
auto const page_size = get_virtual_memory_page_size();
80-
constexpr std::size_t no_blocks{8u};
79+
auto const page_size = get_virtual_memory_page_size();
80+
constexpr std::size_t no_blocks{8u};
8181

8282
virtual_block_allocator alloc{page_size, no_blocks};
8383
auto block = alloc.allocate_block();

0 commit comments

Comments
 (0)