Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Unified Diff: runtime/vm/counters.h

Issue 1343253002: - Remove unused Counters class from isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/counters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/counters.h
diff --git a/runtime/vm/counters.h b/runtime/vm/counters.h
deleted file mode 100644
index ee79b6959e81c4023e9accbae5207925cfff458a..0000000000000000000000000000000000000000
--- a/runtime/vm/counters.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#ifndef VM_COUNTERS_H_
-#define VM_COUNTERS_H_
-
-#include "platform/assert.h"
-
-namespace dart {
-
-struct Counter {
- Counter() : name(NULL), value(0) {}
- const char* name;
- int64_t value;
-};
-
-
-// Light-weight stats counters for temporary experiments/debugging.
-// A single statement is enough to add a counter:
-// ...
-// Isolate::Current()->counters()->Increment("allocated", size_in_bytes);
-// ...
-class Counters {
- public:
- Counters() : collision_(false) {}
-
- // Adds 'delta' to the named counter. 'name' must be a literal string.
- void Increment(const char* name, int64_t delta) {
- Counter& counter =
- counters_[reinterpret_cast<uword>(name) & (kSize - 1)];
- if (counter.name != name && counter.name != NULL) {
- collision_ = true;
- }
- counter.name = name;
- counter.value += delta;
- }
-
- // Prints all counters to stderr.
- ~Counters();
-
- private:
- enum { kSize = 1024 };
- COMPILE_ASSERT((0 == (kSize & (kSize - 1)))); // kSize is a power of 2.
- Counter counters_[kSize];
- bool collision_;
-};
-
-} // namespace dart
-
-#endif // VM_COUNTERS_H_
« no previous file with comments | « no previous file | runtime/vm/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698