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

Unified Diff: third_party/tcmalloc/chromium/src/base/abort.cc

Issue 10535049: Try not to inline tcmalloc::Abort() so we can find it in stack trace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/abort.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/base/abort.cc
===================================================================
--- third_party/tcmalloc/chromium/src/base/abort.cc (revision 0)
+++ third_party/tcmalloc/chromium/src/base/abort.cc (working copy)
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 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/abort.h"
+
+#if defined(TCMALLOC_USE_SYSTEM_ABORT)
+#include <stdlib.h>
+#endif
+#include "base/basictypes.h"
+
+namespace tcmalloc {
+
+// Don't inline so we can find Abort() call from stack trace.
+ATTRIBUTE_NOINLINE void Abort() {
+#if defined(TCMALLOC_USE_SYSTEM_ABORT)
+ abort();
+#else
+ // Make a segmentation fault to force abort.
+ *reinterpret_cast<volatile int*>(NULL) = 0x2001;
jar (doing other things) 2012/06/08 21:02:31 Suggest simplifying to never call system abort. I
+#endif
+}
+
+} // namespace tcmalloc
Property changes on: third_party/tcmalloc/chromium/src/base/abort.cc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/abort.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698