summaryrefslogtreecommitdiff
path: root/tests/string_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/string_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/string_test.cpp')
-rw-r--r--tests/string_test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index a468b97fc..2ab60d771 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -17,6 +17,7 @@
#include <gtest/gtest.h>
#include <errno.h>
+#include <malloc.h>
#include <math.h>
#include <string.h>
@@ -143,9 +144,9 @@ struct StringTestState {
int max_alignment = 64;
// TODO: fix the tests to not sometimes use twice their specified "MAX_LEN".
- glob_ptr = reinterpret_cast<Character*>(valloc(2 * sizeof(Character) * MAX_LEN + max_alignment));
- glob_ptr1 = reinterpret_cast<Character*>(valloc(2 * sizeof(Character) * MAX_LEN + max_alignment));
- glob_ptr2 = reinterpret_cast<Character*>(valloc(2 * sizeof(Character) * MAX_LEN + max_alignment));
+ glob_ptr = reinterpret_cast<Character*>(memalign(sysconf(_SC_PAGESIZE), 2 * sizeof(Character) * MAX_LEN + max_alignment));
+ glob_ptr1 = reinterpret_cast<Character*>(memalign(sysconf(_SC_PAGESIZE), 2 * sizeof(Character) * MAX_LEN + max_alignment));
+ glob_ptr2 = reinterpret_cast<Character*>(memalign(sysconf(_SC_PAGESIZE), 2 * sizeof(Character) * MAX_LEN + max_alignment));
InitLenArray();