Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: crosstest/test_sync_atomic_main.cpp

Issue 1706883003: Subzero. Removes X8664_STACK_HACK from the crosstests. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: removes code setting the stack size Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crosstest/test_strengthreduce_main.cpp ('k') | crosstest/test_vector_ops_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/test_sync_atomic_main.cpp
diff --git a/crosstest/test_sync_atomic_main.cpp b/crosstest/test_sync_atomic_main.cpp
index 37b6b40bb5ab39d36b53afb6b7e790935eecedb2..82b4472de580816009b6e8f2a91e382daa2f0c11 100644
--- a/crosstest/test_sync_atomic_main.cpp
+++ b/crosstest/test_sync_atomic_main.cpp
@@ -176,22 +176,6 @@ template <typename Type> void *threadWrapper(void *Data) {
return NULL;
}
-#ifndef X8664_STACK_HACK
-void AllocStackForThread(uint32, pthread_attr_t *) {}
-#else // defined(X8664_STACK_HACK)
-void AllocStackForThread(uint32 m, pthread_attr_t *attr) {
- static const uint32_t ThreadStackBase = 0x60000000;
- static const uint32_t ThreadStackSize = 4 << 20; // 4MB.
- if (pthread_attr_setstack(
- attr, xAllocStack(ThreadStackBase - 2 * m * ThreadStackSize,
- ThreadStackSize),
- ThreadStackSize) != 0) {
- std::cout << "pthread_attr_setstack: " << strerror(errno) << "\n";
- abort();
- }
-}
-#endif // X8664_STACK_HACK
-
template <typename Type>
void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
size_t &Passes, size_t &Failures) {
@@ -232,7 +216,6 @@ void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
*AtomicLoc = Value1;
for (size_t m = 0; m < NumThreads; ++m) {
pthread_attr_init(&attr[m]);
- AllocStackForThread(m, &attr[m]);
if (pthread_create(&t[m], &attr[m], &threadWrapper<Type>,
reinterpret_cast<void *>(&TDataLlc)) != 0) {
std::cout << "pthread_create failed w/ " << strerror(errno) << "\n";
@@ -248,7 +231,6 @@ void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
*AtomicLoc = Value1;
for (size_t m = 0; m < NumThreads; ++m) {
pthread_attr_init(&attr[m]);
- AllocStackForThread(m, &attr[m]);
if (pthread_create(&t[m], &attr[m], &threadWrapper<Type>,
m % 2 == 0
? reinterpret_cast<void *>(&TDataLlc)
@@ -282,11 +264,7 @@ void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
}
}
-#ifdef X8664_STACK_HACK
-extern "C" int wrapped_main(int argc, char *argv[]) {
-#else // !defined(X8664_STACK_HACK)
int main(int argc, char *argv[]) {
-#endif // X8664_STACK_HACK
size_t TotalTests = 0;
size_t Passes = 0;
size_t Failures = 0;
« no previous file with comments | « crosstest/test_strengthreduce_main.cpp ('k') | crosstest/test_vector_ops_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698