mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1049068 - Part 6: Remove CallStack. r=froydnj
--HG-- extra : rebase_source : 353235acfc8bba8c0d7d578bc6cfa19135af1072
This commit is contained in:
parent
fd41273704
commit
a5a7b80dad
@ -1,11 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DeadlockDetector.h"
|
||||
|
||||
namespace mozilla {
|
||||
const CallStack CallStack::kNone((CallStack::callstack_id)-1);
|
||||
}
|
@ -15,73 +15,8 @@
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#ifdef NS_TRACE_MALLOC
|
||||
# include "nsTraceMalloc.h"
|
||||
#endif // ifdef NS_TRACE_MALLOC
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
||||
// FIXME bug 456272: split this off into a convenience API on top of
|
||||
// nsStackWalk?
|
||||
class NS_COM_GLUE CallStack
|
||||
{
|
||||
private:
|
||||
#ifdef NS_TRACE_MALLOC
|
||||
typedef nsTMStackTraceID callstack_id;
|
||||
// needs to be a macro to avoid disturbing the backtrace
|
||||
# define NS_GET_BACKTRACE() NS_TraceMallocGetStackTrace()
|
||||
# define NS_DEADLOCK_DETECTOR_CONSTEXPR
|
||||
#else
|
||||
typedef void* callstack_id;
|
||||
# define NS_GET_BACKTRACE() 0
|
||||
# define NS_DEADLOCK_DETECTOR_CONSTEXPR MOZ_CONSTEXPR
|
||||
#endif // ifdef NS_TRACE_MALLOC
|
||||
|
||||
callstack_id mCallStack;
|
||||
|
||||
public:
|
||||
/**
|
||||
* CallStack
|
||||
* *ALWAYS* *ALWAYS* *ALWAYS* call this with no arguments. This
|
||||
* constructor takes an argument *ONLY* so that |GET_BACKTRACE()|
|
||||
* can be evaluated in the stack frame of the caller, rather than
|
||||
* that of the constructor.
|
||||
*
|
||||
* *BEWARE*: this means that calling this constructor with no
|
||||
* arguments is not the same as a "default, do-nothing"
|
||||
* constructor: it *will* construct a backtrace. This can cause
|
||||
* unexpected performance issues.
|
||||
*/
|
||||
NS_DEADLOCK_DETECTOR_CONSTEXPR
|
||||
explicit CallStack(const callstack_id aCallStack = NS_GET_BACKTRACE())
|
||||
: mCallStack(aCallStack)
|
||||
{
|
||||
}
|
||||
NS_DEADLOCK_DETECTOR_CONSTEXPR
|
||||
CallStack(const CallStack& aFrom)
|
||||
: mCallStack(aFrom.mCallStack)
|
||||
{
|
||||
}
|
||||
CallStack& operator=(const CallStack& aFrom)
|
||||
{
|
||||
mCallStack = aFrom.mCallStack;
|
||||
return *this;
|
||||
}
|
||||
bool operator==(const CallStack& aOther) const
|
||||
{
|
||||
return mCallStack == aOther.mCallStack;
|
||||
}
|
||||
bool operator!=(const CallStack& aOther) const
|
||||
{
|
||||
return mCallStack != aOther.mCallStack;
|
||||
}
|
||||
|
||||
/** The "null" callstack. */
|
||||
static const CallStack kNone;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* DeadlockDetector
|
||||
*
|
||||
|
@ -40,7 +40,6 @@ xpcom_glue_src_cppsrcs = [
|
||||
|
||||
xpcom_gluens_src_lcppsrcs = [
|
||||
'BlockingResourceBase.cpp',
|
||||
'DeadlockDetector.cpp',
|
||||
'GenericFactory.cpp',
|
||||
'nsProxyRelease.cpp',
|
||||
'nsTextFormatter.cpp',
|
||||
|
Loading…
Reference in New Issue
Block a user