Commit 49e4b033 authored by kaiwang@chromium.org's avatar kaiwang@chromium.org

Try not to inline tcmalloc::Abort() so we can find it in stack trace.

Review URL: https://chromiumcodereview.appspot.com/10535049

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141295 0039d316-1c4b-4281-b951-d872f2087c98
parent f61f4781
......@@ -52,8 +52,10 @@
# all tcmalloc native and forked files
'<(tcmalloc_dir)/src/addressmap-inl.h',
'<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
'<(tcmalloc_dir)/src/base/abort.cc',
'<(tcmalloc_dir)/src/base/abort.h',
'<(tcmalloc_dir)/src/base/arm_instruction_set_select.h',
'<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
'<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h',
'<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h',
'<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
......
// 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"
#include "base/basictypes.h"
namespace tcmalloc {
// Try not to inline so we can find Abort() call from stack trace.
ATTRIBUTE_NOINLINE void Abort() {
// Make a segmentation fault to force abort. Writing to a specific address
// so it's easier to find on crash stacks.
*(reinterpret_cast<volatile char*>(NULL) + 57) = 0x2001;
}
} // namespace tcmalloc
......@@ -6,29 +6,14 @@
// On some platforms abort() is implemented in a way that Chrome's crash
// reporter treats it as a normal exit. See issue:
// http://code.google.com/p/chromium/issues/detail?id=118665
// So we replace abort with a
// segmentation fault, that crash reporter can always detect.
// So we replace abort with a segmentation fault, then crash reporter can
// always detect.
#ifndef BASE_ABORT_H_
#define BASE_ABORT_H_
#if defined(TCMALLOC_USE_SYSTEM_ABORT)
#include <stdlib.h>
namespace tcmalloc {
inline void Abort() {
abort();
}
void Abort();
} // namespace tcmalloc
#else
namespace tcmalloc {
inline void Abort() {
// Make a segmentation fault to force abort.
*reinterpret_cast<volatile int*>(NULL) = 0x2001;
}
} // namespace tcmalloc
#endif
#endif // BASE_ABORT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment