summaryrefslogtreecommitdiff
path: root/tests/malloc_test.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-06-12 10:55:13 -0700
committerDan Albert <danalbert@google.com>2014-06-13 15:35:05 -0700
commit5ee320dd35fafc11eaf90c62198e08c6670e35b4 (patch)
treec17c2b67e2f12161e67f9b337c9cdc11bd8eab5f /tests/malloc_test.cpp
parent0f690d9eda1893e66223138d2b930eb3e0164820 (diff)
Hides valloc(3)/pvalloc(3) on LP64.
These were removed from POSIX 2004. Hides the header declarations for all targets, and hides the symbols for LP64. Bug: 13935372 Change-Id: Id592f67e9b7051517a05f536e1373b30162e669c
Diffstat (limited to 'tests/malloc_test.cpp')
-rw-r--r--tests/malloc_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index ed98f15d3..d70136496 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -22,6 +22,10 @@
#include <malloc.h>
#include <unistd.h>
+#if defined(__BIONIC__)
+#include <libc/bionic/malloc_debug_common.h>
+#endif
+
TEST(malloc, malloc_std) {
// Simple malloc test.
void *ptr = malloc(100);
@@ -291,6 +295,10 @@ TEST(malloc, realloc_overflow) {
free(ptr);
}
+#if defined(HAVE_DEPRECATED_MALLOC_FUNCS)
+extern "C" void* pvalloc(size_t);
+extern "C" void* valloc(size_t);
+
TEST(malloc, pvalloc_std) {
size_t pagesize = sysconf(_SC_PAGESIZE);
void* ptr = pvalloc(100);
@@ -315,3 +323,4 @@ TEST(malloc, valloc_std) {
TEST(malloc, valloc_overflow) {
ASSERT_EQ(NULL, valloc(SIZE_MAX));
}
+#endif