From 5618ef78505a854bd0d2c145fd9cf7967226a20e Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Mon, 20 Feb 2017 15:31:41 -0800 Subject: [PATCH] Don't assume memalign exists in memalign vs nallocx test OSX and windows have issues with memalign. So test against tc_memalign instead. This should fix _memalign linker-time part of issue #870. --- src/tests/tcmalloc_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc index f1ea00121..0bf18e78d 100644 --- a/src/tests/tcmalloc_unittest.cc +++ b/src/tests/tcmalloc_unittest.cc @@ -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); }