forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dynamic annotation files into base/.
Added annotations for atomic reference counting, LazyInstance and Singleton classes. This changelist is a part of an effort of adding ThreadSanitizer support for Chromium. See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer Patch by Timur Iskhodzhanov. Review URL: http://codereview.chromium.org/147008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19353 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
deanm@chromium.org
committed
Jun 26, 2009
1 parent
09e5f47
commit 001b694
Showing
7 changed files
with
468 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/dynamic_annotations.h" | ||
#include "base/third_party/valgrind/valgrind.h" | ||
|
||
#ifndef NDEBUG | ||
// Each function is empty and called (via a macro) only in debug mode. | ||
// The arguments are captured by dynamic tools at runtime. | ||
|
||
extern "C" void AnnotateRWLockCreate(const char *file, int line, | ||
const volatile void *lock) {} | ||
extern "C" void AnnotateRWLockDestroy(const char *file, int line, | ||
const volatile void *lock) {} | ||
extern "C" void AnnotateRWLockAcquired(const char *file, int line, | ||
const volatile void *lock, long is_w) {} | ||
extern "C" void AnnotateRWLockReleased(const char *file, int line, | ||
const volatile void *lock, long is_w) {} | ||
extern "C" void AnnotateCondVarWait(const char *file, int line, | ||
const volatile void *cv, | ||
const volatile void *lock) {} | ||
extern "C" void AnnotateCondVarSignal(const char *file, int line, | ||
const volatile void *cv) {} | ||
extern "C" void AnnotateCondVarSignalAll(const char *file, int line, | ||
const volatile void *cv) {} | ||
extern "C" void AnnotatePublishMemoryRange(const char *file, int line, | ||
const volatile void *address, | ||
long size) {} | ||
extern "C" void AnnotatePCQCreate(const char *file, int line, | ||
const volatile void *pcq) {} | ||
extern "C" void AnnotatePCQDestroy(const char *file, int line, | ||
const volatile void *pcq) {} | ||
extern "C" void AnnotatePCQPut(const char *file, int line, | ||
const volatile void *pcq) {} | ||
extern "C" void AnnotatePCQGet(const char *file, int line, | ||
const volatile void *pcq) {} | ||
extern "C" void AnnotateNewMemory(const char *file, int line, | ||
const volatile void *mem, | ||
long size) {} | ||
extern "C" void AnnotateExpectRace(const char *file, int line, | ||
const volatile void *mem, | ||
const char *description) {} | ||
extern "C" void AnnotateBenignRace(const char *file, int line, | ||
const volatile void *mem, | ||
const char *description) {} | ||
extern "C" void AnnotateMutexIsUsedAsCondVar(const char *file, int line, | ||
const volatile void *mu) {} | ||
extern "C" void AnnotateTraceMemory(const char *file, int line, | ||
const volatile void *arg) {} | ||
extern "C" void AnnotateThreadName(const char *file, int line, | ||
const char *name) {} | ||
extern "C" void AnnotateIgnoreReadsBegin(const char *file, int line) {} | ||
extern "C" void AnnotateIgnoreReadsEnd(const char *file, int line) {} | ||
extern "C" void AnnotateIgnoreWritesBegin(const char *file, int line) {} | ||
extern "C" void AnnotateIgnoreWritesEnd(const char *file, int line) {} | ||
extern "C" void AnnotateNoOp(const char *file, int line, | ||
const volatile void *arg) {} | ||
#endif // NDEBUG | ||
|
||
// When running under valgrind, a non-zero value will be returned. | ||
extern "C" int RunningOnValgrind() { | ||
#if defined(NVALGRIND) | ||
return 0; | ||
#else | ||
return RUNNING_ON_VALGRIND; | ||
#endif | ||
} |
Oops, something went wrong.