Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_COMPILER_SPECIFIC_H_ | 5 #ifndef BASE_COMPILER_SPECIFIC_H_ |
| 6 #define BASE_COMPILER_SPECIFIC_H_ | 6 #define BASE_COMPILER_SPECIFIC_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(COMPILER_MSVC) | 10 #if defined(COMPILER_MSVC) |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 #define PRINTF_FORMAT(format_param, dots_param) | 159 #define PRINTF_FORMAT(format_param, dots_param) |
| 160 #endif | 160 #endif |
| 161 | 161 |
| 162 // WPRINTF_FORMAT is the same, but for wide format strings. | 162 // WPRINTF_FORMAT is the same, but for wide format strings. |
| 163 // This doesn't appear to yet be implemented in any compiler. | 163 // This doesn't appear to yet be implemented in any compiler. |
| 164 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . | 164 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . |
| 165 #define WPRINTF_FORMAT(format_param, dots_param) | 165 #define WPRINTF_FORMAT(format_param, dots_param) |
| 166 // If available, it would look like: | 166 // If available, it would look like: |
| 167 // __attribute__((format(wprintf, format_param, dots_param))) | 167 // __attribute__((format(wprintf, format_param, dots_param))) |
| 168 | 168 |
| 169 | |
| 170 // MemorySanitizer annotations. | |
| 171 #ifdef MEMORY_SANITIZER | |
| 172 extern "C" { | |
| 173 void __msan_unpoison(const void *p, unsigned long s); | |
| 174 void __msan_print_shadow(const void *p, unsigned long s); | |
|
Alexander Potapenko
2013/03/20 11:43:08
Please remove __msan_print_shadow since it's unlik
| |
| 175 } | |
| 176 | |
| 177 // Mark a memory region fully initialized. | |
| 178 // Use this to annotate the code that deliberately reads uninitialized data, | |
| 179 // for example a GC scavenging root set pointers from stack. | |
| 180 #define MSAN_UNPOISON(p, s) __msan_unpoison(p, s) | |
| 181 | |
| 182 // Dump MSan shadow of the memory region to stderr. | |
| 183 // MSan shadow is a bitmask with 1's in place of uninitialized bits. | |
| 184 #define MSAN_PRINT_SHADOW(p, s) __msan_print_shadow(p, s) | |
| 185 #else // MEMORY_SANITIZER | |
| 186 #define MSAN_UNPOISON(p, s) | |
| 187 #define MSAN_PRINT_SHADOW(p, s) | |
| 188 #endif // MEMORY_SANITIZER | |
| 189 | |
| 169 #endif // BASE_COMPILER_SPECIFIC_H_ | 190 #endif // BASE_COMPILER_SPECIFIC_H_ |
| OLD | NEW |