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

Side by Side Diff: base/security_unittest.cc

Issue 15766009: Disable tcmalloc security tests on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 28 matching lines...) Expand all
39 // more robust than merely using "volatile". 39 // more robust than merely using "volatile".
40 __asm__ volatile ("" : "+r" (value)); 40 __asm__ volatile ("" : "+r" (value));
41 #endif // __GNUC__ 41 #endif // __GNUC__
42 return value; 42 return value;
43 } 43 }
44 44
45 // - NO_TCMALLOC (should be defined if we compile with linux_use_tcmalloc=0) 45 // - NO_TCMALLOC (should be defined if we compile with linux_use_tcmalloc=0)
46 // - ADDRESS_SANITIZER because it has its own memory allocator 46 // - ADDRESS_SANITIZER because it has its own memory allocator
47 // - IOS does not use tcmalloc 47 // - IOS does not use tcmalloc
48 // - OS_MACOSX does not use tcmalloc 48 // - OS_MACOSX does not use tcmalloc
49 // - OS_WIN does not use tcmalloc crbug.com/242304
49 #if !defined(NO_TCMALLOC) && !defined(ADDRESS_SANITIZER) && \ 50 #if !defined(NO_TCMALLOC) && !defined(ADDRESS_SANITIZER) && \
50 !defined(OS_IOS) && !defined(OS_MACOSX) 51 !defined(OS_IOS) && !defined(OS_MACOSX) && !defined(OS_WIN)
51 #define TCMALLOC_TEST(function) function 52 #define TCMALLOC_TEST(function) function
52 #else 53 #else
53 #define TCMALLOC_TEST(function) DISABLED_##function 54 #define TCMALLOC_TEST(function) DISABLED_##function
54 #endif 55 #endif
55 56
56 // TODO(jln): switch to std::numeric_limits<int>::max() when we switch to 57 // TODO(jln): switch to std::numeric_limits<int>::max() when we switch to
57 // C++11. 58 // C++11.
58 const size_t kTooBigAllocSize = INT_MAX; 59 const size_t kTooBigAllocSize = INT_MAX;
59 60
60 // Detect runtime TCMalloc bypasses. 61 // Detect runtime TCMalloc bypasses.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // kRandomMask, so we use it as an additional detection mechanism. 292 // kRandomMask, so we use it as an additional detection mechanism.
292 const uintptr_t kRandomMask = 0x3fffffffffffULL; 293 const uintptr_t kRandomMask = 0x3fffffffffffULL;
293 bool impossible_random_address = 294 bool impossible_random_address =
294 reinterpret_cast<uintptr_t>(ptr.get()) & ~kRandomMask; 295 reinterpret_cast<uintptr_t>(ptr.get()) & ~kRandomMask;
295 EXPECT_FALSE(impossible_random_address); 296 EXPECT_FALSE(impossible_random_address);
296 } 297 }
297 298
298 #endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__) 299 #endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__)
299 300
300 } // namespace 301 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698