summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2014-02-25 21:40:11 +0100
committerAliaksey Kandratsenka <alk@tut.by>2014-03-01 11:26:27 -0800
commita7223c2a14431ffd783117c55f84a2c84423d313 (patch)
treea513cc7a7056b772c3f32d7649e444450dc3d033
parentbd9665ebbe1aca5e1ba993de4214e64ee8bbe43a (diff)
downloadgperftools-a7223c2a14431ffd783117c55f84a2c84423d313.tar.gz
Test for memalign in configure.ac. Disable a test that uses memalign if it is not found.
Signed-off-by: Aliaksey Kandratsenka <alk@tut.by>
-rw-r--r--configure.ac1
-rw-r--r--src/tests/debugallocation_test.cc2
2 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8f7ea5f..4823cc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,6 +116,7 @@ AC_CHECK_TYPES([Elf32_Versym],,, [#include <elf.h>]) # for vdso_support.h
AC_CHECK_FUNCS(sbrk) # for tcmalloc to get memory
AC_CHECK_FUNCS(geteuid) # for turning off services when run as root
AC_CHECK_FUNCS(fork) # for the pthread_atfork setup
+AC_CHECK_FUNCS(memalign) # for a test case
AC_CHECK_HEADERS(features.h) # for vdso_support.h
AC_CHECK_HEADERS(malloc.h) # some systems define stuff there, others not
AC_CHECK_HEADERS(sys/malloc.h) # where some versions of OS X put malloc.h
diff --git a/src/tests/debugallocation_test.cc b/src/tests/debugallocation_test.cc
index beeb4cf..8e14830 100644
--- a/src/tests/debugallocation_test.cc
+++ b/src/tests/debugallocation_test.cc
@@ -298,6 +298,7 @@ TEST(DebugAllocationTest, HugeAlloc) {
#endif
}
+#ifdef HAVE_MEMALIGN
// based on test program contributed by mikesart@gmail.com aka
// mikesart@valvesoftware.com. See issue-464.
TEST(DebugAllocationTest, ReallocAfterMemalloc) {
@@ -313,6 +314,7 @@ TEST(DebugAllocationTest, ReallocAfterMemalloc) {
int rv = memcmp(stuff, p, sizeof(stuff));
EXPECT_EQ(rv, 0);
}
+#endif
int main(int argc, char** argv) {
// If you run without args, we run the non-death parts of the test.