Bug 1769952 - Fix running raptor on a Win10-64 VM r=sparky
[gecko.git] / tools / jprof / intcnt.h
blob3c5820965a11feb1633c91b1582c5213b03762c9
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef INTCNT_H
6 #define INTCNT_H
8 class IntCount {
9 public:
10 IntCount();
11 ~IntCount();
12 void clear();
13 int countAdd(int index, int increment = 1);
14 int countGet(int index);
15 int getSize();
16 int getCount(int pos);
17 int getIndex(int pos);
19 IntCount(const IntCount& old) {
20 numInts = old.numInts;
21 if (numInts > 0) {
22 iPair = new IntPair[numInts];
23 for (int i = 0; i < numInts; i++) {
24 iPair[i] = old.iPair[i];
26 } else {
27 iPair = nullptr;
31 private:
32 int numInts;
33 struct IntPair {
34 int idx;
35 int cnt;
36 } * iPair;
39 #endif