1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsStringStats_h
8 #define nsStringStats_h
10 #include "mozilla/Atomics.h"
14 nsStringStats() = default;
18 using AtomicInt
= mozilla::Atomic
<int32_t, mozilla::SequentiallyConsistent
>;
20 AtomicInt mAllocCount
{0};
21 AtomicInt mReallocCount
{0};
22 AtomicInt mFreeCount
{0};
23 AtomicInt mShareCount
{0};
24 AtomicInt mAdoptCount
{0};
25 AtomicInt mAdoptFreeCount
{0};
28 extern nsStringStats gStringStats
;
30 #define STRING_STAT_INCREMENT(_s) (gStringStats.m##_s##Count)++
32 #endif // nsStringStats_h