summaryrefslogtreecommitdiffstats
path: root/base/third_party/purify
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:36:35 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:36:35 +0000
commitdf42d4adc3280f1e0cbba03b76fdab59ad2abf11 (patch)
treeb10fc91ef39c1a10b158631a887fef3b823bbe51 /base/third_party/purify
parentadd87127f39d469a8e48666e826f8c80051cf9ef (diff)
downloadchromium_src-df42d4adc3280f1e0cbba03b76fdab59ad2abf11.zip
chromium_src-df42d4adc3280f1e0cbba03b76fdab59ad2abf11.tar.gz
chromium_src-df42d4adc3280f1e0cbba03b76fdab59ad2abf11.tar.bz2
Refactor Quantify Profiling a bit.
This lets you use regular full-optimization Release builds. Review URL: http://codereview.chromium.org/53022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/third_party/purify')
-rw-r--r--base/third_party/purify/pure.h4
-rw-r--r--base/third_party/purify/pure_api.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/base/third_party/purify/pure.h b/base/third_party/purify/pure.h
index 56d4be6..ed50a37 100644
--- a/base/third_party/purify/pure.h
+++ b/base/third_party/purify/pure.h
@@ -7,7 +7,7 @@
* Version 1.0
*/
-#ifdef PURIFY
+#if defined(PURIFY) || defined(QUANTIFY)
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
@@ -142,4 +142,4 @@ int __cdecl CoverageSaveData(void) ;
}
#endif
-#endif // PURIFY
+#endif // defined(PURIFY) || defined(QUANTIFY) \ No newline at end of file
diff --git a/base/third_party/purify/pure_api.c b/base/third_party/purify/pure_api.c
index 1248ac3..7203cfd 100644
--- a/base/third_party/purify/pure_api.c
+++ b/base/third_party/purify/pure_api.c
@@ -16,7 +16,14 @@
* to prevent optimizing the functions away when compiler option
* /Gy is set. This is needed so that NOTE2 works properly.
*/
-#ifdef PURIFY
+
+// Chromium note: We used to only compile this code if PURIFY was defined,
+// because we did special builds with all optimizations turned off for Purify.
+// However, for profiling with Quantify, we want most/all optimizations turned
+// on so that we measure something closer to real execution.
+
+#ifdef _WINDOWS // we only use Purify/Quantify on Windows
+
#pragma once
extern int errno;
typedef int ptrdiff_t;
@@ -142,4 +149,4 @@ __declspec(dllexport) int __cdecl QuantifyAddAnnotation(char *str) { if(!++avoid
__declspec(dllexport) int __cdecl QuantifySaveData(void) { if(!++avoidGy_49); return 0; }
__declspec(dllexport) int __cdecl QuantifySetThreadName(const char *szName) { if(!++avoidGy_50) ; szName; return 0; }
-#endif // PURIFY
+#endif // _WINDOWS