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

Unified Diff: runtime/vm/trace_buffer.h

Issue 243583008: Undo r35207 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/trace_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/trace_buffer.h
diff --git a/runtime/vm/trace_buffer.h b/runtime/vm/trace_buffer.h
index e6b325e310a9075d942678e6eda6ad91976428be..f8b1c78de406e15451c8fb8cefbb36dcf68dd095 100644
--- a/runtime/vm/trace_buffer.h
+++ b/runtime/vm/trace_buffer.h
@@ -11,7 +11,6 @@
namespace dart {
-class JSONObject;
class JSONStream;
struct TraceBufferEntry {
@@ -24,13 +23,9 @@ struct TraceBufferEntry {
class TraceBuffer {
public:
- static const intptr_t kInitialCapacity = 16;
- static const intptr_t kMaximumCapacity = 1024;
+ static const intptr_t kDefaultCapacity = 1024;
- // TraceBuffer starts with kInitialCapacity and will expand itself until
- // it reaches kMaximumCapacity.
- TraceBuffer(intptr_t initial_capacity = kInitialCapacity,
- intptr_t maximum_capacity = kMaximumCapacity);
+ explicit TraceBuffer(intptr_t capacity = kDefaultCapacity);
~TraceBuffer();
void Clear();
@@ -41,26 +36,20 @@ class TraceBuffer {
void Trace(const char* message);
void TraceF(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
- void PrintToJSONObject(JSONObject* obj) const;
void PrintToJSONStream(JSONStream* stream) const;
- intptr_t capacity() const { return capacity_; }
-
private:
void Init();
- void Resize(intptr_t capacity);
void Cleanup();
void Fill(TraceBufferEntry* entry, int64_t micros, char* msg);
void AppendTrace(int64_t micros, char* message);
TraceBufferEntry* ring_;
- intptr_t size_;
- intptr_t capacity_;
+ const intptr_t ring_capacity_;
intptr_t ring_cursor_;
- const intptr_t max_capacity_;
intptr_t RingIndex(intptr_t i) const {
- return i % capacity_;
+ return i % ring_capacity_;
}
DISALLOW_COPY_AND_ASSIGN(TraceBuffer);
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/trace_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698