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

Side by Side Diff: third_party/tcmalloc/chromium/src/tests/testutil.cc

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2007, Google Inc. 1 // Copyright (c) 2007, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 #endif /* HAVE_SYS_RESOURCE_H */ 74 #endif /* HAVE_SYS_RESOURCE_H */
75 } 75 }
76 76
77 77
78 struct FunctionAndId { 78 struct FunctionAndId {
79 void (*ptr_to_function)(int); 79 void (*ptr_to_function)(int);
80 int id; 80 int id;
81 }; 81 };
82 82
83 #if defined(NO_THREADS) || !(defined(HAVE_PTHREADS) || defined(_WIN32)) 83 #if defined(NO_THREADS) || !(defined(HAVE_PTHREAD) || defined(_WIN32))
84 84
85 extern "C" void RunThread(void (*fn)()) { 85 extern "C" void RunThread(void (*fn)()) {
86 (*fn)(); 86 (*fn)();
87 } 87 }
88 88
89 extern "C" void RunManyThreads(void (*fn)(), int count) { 89 extern "C" void RunManyThreads(void (*fn)(), int count) {
90 // I guess the best we can do is run fn sequentially, 'count' times 90 // I guess the best we can do is run fn sequentially, 'count' times
91 for (int i = 0; i < count; i++) 91 for (int i = 0; i < count; i++)
92 (*fn)(); 92 (*fn)();
93 } 93 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 SAFE_PTHREAD(pthread_join(thr[i], NULL)); 214 SAFE_PTHREAD(pthread_join(thr[i], NULL));
215 } 215 }
216 delete[] fn_and_ids; 216 delete[] fn_and_ids;
217 delete[] thr; 217 delete[] thr;
218 218
219 pthread_attr_destroy(&attr); 219 pthread_attr_destroy(&attr);
220 } 220 }
221 } 221 }
222 222
223 #endif 223 #endif
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/tests/tcmalloc_unittest.cc ('k') | third_party/tcmalloc/chromium/src/thread_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698