Skip to content

Commit

Permalink
Don't assume memalign exists in memalign vs nallocx test
Browse files Browse the repository at this point in the history
OSX and windows have issues with memalign. So test against tc_memalign
instead.

This should fix _memalign linker-time part of issue gperftools#870.
  • Loading branch information
alk committed Feb 20, 2017
1 parent bf640cd commit 5618ef7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tests/tcmalloc_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ static void TestNAllocXAlignment() {
size_t rounded = nallocx(size, MALLOCX_LG_ALIGN(align));
ASSERT_GE(rounded, size);
ASSERT_EQ(rounded % (1 << align), 0);
void* ptr = memalign(1 << align, size);
void* ptr = tc_memalign(1 << align, size);
ASSERT_EQ(rounded, MallocExtension::instance()->GetAllocatedSize(ptr));
free(ptr);
}
Expand Down

0 comments on commit 5618ef7

Please sign in to comment.