2014-05-05 17:30:39 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2014-02-26 21:36:36 +00:00
|
|
|
#ifndef nsTraceRefcnt_h___
|
|
|
|
#define nsTraceRefcnt_h___
|
1998-10-19 17:48:55 +00:00
|
|
|
|
2003-12-12 23:02:12 +00:00
|
|
|
#include <stdio.h> // for FILE
|
2014-02-24 23:27:53 +00:00
|
|
|
#include "nscore.h"
|
1999-10-04 23:36:18 +00:00
|
|
|
|
2014-02-26 21:36:36 +00:00
|
|
|
class nsTraceRefcnt
|
2003-08-05 05:29:10 +00:00
|
|
|
{
|
1999-10-08 20:29:47 +00:00
|
|
|
public:
|
2011-08-18 13:46:39 +00:00
|
|
|
static void Shutdown();
|
2000-06-15 02:23:55 +00:00
|
|
|
|
2016-10-10 17:56:09 +00:00
|
|
|
static nsresult DumpStatistics();
|
2008-08-03 21:39:04 +00:00
|
|
|
|
2014-05-13 17:41:38 +00:00
|
|
|
static void ResetStatistics();
|
1999-10-08 20:29:47 +00:00
|
|
|
|
2011-08-18 13:46:39 +00:00
|
|
|
static void WalkTheStack(FILE* aStream);
|
2014-08-01 16:27:35 +00:00
|
|
|
|
2000-12-23 16:43:32 +00:00
|
|
|
/**
|
|
|
|
* Tell nsTraceRefcnt whether refcounting, allocation, and destruction
|
|
|
|
* activity is legal. This is used to trigger assertions for any such
|
|
|
|
* activity that occurs because of static constructors or destructors.
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
static void SetActivityIsLegal(bool aLegal);
|
1999-10-08 20:29:47 +00:00
|
|
|
};
|
1999-10-07 21:50:20 +00:00
|
|
|
|
2000-02-05 02:07:45 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// And now for that utility that you've all been asking for...
|
|
|
|
|
2011-08-18 13:46:39 +00:00
|
|
|
extern "C" void
|
2014-05-13 17:41:38 +00:00
|
|
|
NS_MeanAndStdDev(double aNumberOfValues,
|
|
|
|
double aSumOfValues, double aSumOfSquaredValues,
|
|
|
|
double* aMeanResult, double* aStdDevResult);
|
2000-02-05 02:07:45 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2003-08-05 05:29:10 +00:00
|
|
|
#endif
|