gecko-dev/xpcom/ds/nsAtomTable.h
Nicholas Nethercote 7ac2324679 Bug 1441430 - Provide more detail about atoms memory usage. r=froydnj
The old output had a single value: "atoms-table". The new output looks like
this:

> 649,904 B (00.39%) -- atoms
> ├──350,256 B (00.21%) -- dynamic
> │  ├──235,056 B (00.14%) ── unshared-buffers
> │  └──115,200 B (00.07%) ── atom-objects
> ├──212,992 B (00.13%) ── table
> └───86,656 B (00.05%) ── static/atom-objects

MozReview-Commit-ID: 924vUmxHAlh

--HG--
extra : rebase_source : 6c977546a69eeee62ebc87e335982e8278217484
2018-02-28 11:05:07 +11:00

37 lines
929 B
C++

/* -*- 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/. */
#ifndef nsAtomTable_h__
#define nsAtomTable_h__
#include "mozilla/MemoryReporting.h"
#include <stddef.h>
void NS_InitAtomTable();
void NS_ShutdownAtomTable();
namespace mozilla {
struct AtomsSizes
{
size_t mTable;
size_t mStaticAtomObjects;
size_t mDynamicAtomObjects;
size_t mDynamicUnsharedBuffers;
AtomsSizes()
: mTable(0)
, mStaticAtomObjects(0)
, mDynamicAtomObjects(0)
, mDynamicUnsharedBuffers(0)
{}
};
} // namespace mozilla
void NS_AddSizeOfAtoms(mozilla::MallocSizeOf aMallocSizeOf,
mozilla::AtomsSizes& aSizes);
#endif // nsAtomTable_h__