mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
60b1f563cb
This reduces memory usage because we only need one allocation instead of two for the dynamic atom and its chars, and because we don't need to store a refcount and a size. It precludes sharing of chars between dynamic atoms, but we weren't benefiting much from that anyway. This reduces per-process memory usage by up to several hundred KiB on my Linux64 box. One consequence of this change is that we need to allocate + copy in DOMString::SetKnownLiveAtom(), which could make some things slower. --HG-- extra : rebase_source : ba4065ea31e509dd985c003614199f73def0596c
33 lines
795 B
C++
33 lines
795 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 mDynamicAtoms;
|
|
|
|
AtomsSizes()
|
|
: mTable(0)
|
|
, mDynamicAtoms(0)
|
|
{}
|
|
};
|
|
} // namespace mozilla
|
|
|
|
void NS_AddSizeOfAtoms(mozilla::MallocSizeOf aMallocSizeOf,
|
|
mozilla::AtomsSizes& aSizes);
|
|
|
|
#endif // nsAtomTable_h__
|