OLD | NEW |
1 /* Copyright (c) 2011, Google Inc. | 1 /* Copyright (c) 2011, 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 The arguments are captured by dynamic tools at runtime. */ | 54 The arguments are captured by dynamic tools at runtime. */ |
55 | 55 |
56 #if DYNAMIC_ANNOTATIONS_ENABLED == 1 \ | 56 #if DYNAMIC_ANNOTATIONS_ENABLED == 1 \ |
57 && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 | 57 && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 |
58 | 58 |
59 /* Identical code folding(-Wl,--icf=all) countermeasures. | 59 /* Identical code folding(-Wl,--icf=all) countermeasures. |
60 This makes all Annotate* functions different, which prevents the linker from | 60 This makes all Annotate* functions different, which prevents the linker from |
61 folding them. */ | 61 folding them. */ |
62 #ifdef __COUNTER__ | 62 #ifdef __COUNTER__ |
63 #define DYNAMIC_ANNOTATIONS_IMPL \ | 63 #define DYNAMIC_ANNOTATIONS_IMPL \ |
64 volatile short lineno = (__LINE__ << 8) + __COUNTER__; (void)lineno; | 64 volatile unsigned short lineno = (__LINE__ << 8) + __COUNTER__; (void)lineno; |
65 #else | 65 #else |
66 #define DYNAMIC_ANNOTATIONS_IMPL \ | 66 #define DYNAMIC_ANNOTATIONS_IMPL \ |
67 volatile short lineno = (__LINE__ << 8); (void)lineno; | 67 volatile unsigned short lineno = (__LINE__ << 8); (void)lineno; |
68 #endif | 68 #endif |
69 | 69 |
70 /* WARNING: always add new annotations to the end of the list. | 70 /* WARNING: always add new annotations to the end of the list. |
71 Otherwise, lineno (see above) numbers for different Annotate* functions may | 71 Otherwise, lineno (see above) numbers for different Annotate* functions may |
72 conflict. */ | 72 conflict. */ |
73 void DYNAMIC_ANNOTATIONS_NAME(AnnotateRWLockCreate)( | 73 void DYNAMIC_ANNOTATIONS_NAME(AnnotateRWLockCreate)( |
74 const char *file, int line, const volatile void *lock) | 74 const char *file, int line, const volatile void *lock) |
75 {DYNAMIC_ANNOTATIONS_IMPL} | 75 {DYNAMIC_ANNOTATIONS_IMPL} |
76 | 76 |
77 void DYNAMIC_ANNOTATIONS_NAME(AnnotateRWLockDestroy)( | 77 void DYNAMIC_ANNOTATIONS_NAME(AnnotateRWLockDestroy)( |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 /* C doesn't have thread-safe initialization of statics, and we | 260 /* C doesn't have thread-safe initialization of statics, and we |
261 don't want to depend on pthread_once here, so hack it. */ | 261 don't want to depend on pthread_once here, so hack it. */ |
262 int local_running_on_valgrind = running_on_valgrind; | 262 int local_running_on_valgrind = running_on_valgrind; |
263 if (local_running_on_valgrind == -1) | 263 if (local_running_on_valgrind == -1) |
264 running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); | 264 running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); |
265 return local_running_on_valgrind; | 265 return local_running_on_valgrind; |
266 } | 266 } |
267 | 267 |
268 #endif /* DYNAMIC_ANNOTATIONS_PROVIDE_RUNNING_ON_VALGRIND == 1 | 268 #endif /* DYNAMIC_ANNOTATIONS_PROVIDE_RUNNING_ON_VALGRIND == 1 |
269 && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 */ | 269 && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 */ |
OLD | NEW |