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

Unified Diff: runtime/vm/zone_text_buffer.h

Issue 2686813006: Reapply "Use CodeSourceMap for stack traces (still JIT only)." (Closed)
Patch Set: Created 3 years, 10 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/vm_sources.gypi ('k') | runtime/vm/zone_text_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone_text_buffer.h
diff --git a/runtime/vm/zone_text_buffer.h b/runtime/vm/zone_text_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d6ae1154065e66180f6c7d316ca0c55f3dcf65b
--- /dev/null
+++ b/runtime/vm/zone_text_buffer.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2017, 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 RUNTIME_VM_ZONE_TEXT_BUFFER_H_
+#define RUNTIME_VM_ZONE_TEXT_BUFFER_H_
+
+#include "vm/allocation.h"
+#include "vm/globals.h"
+
+namespace dart {
+
+class Zone;
+
+// TextBuffer maintains a dynamic character buffer with a printf-style way to
+// append text.
+class ZoneTextBuffer : ValueObject {
+ public:
+ ZoneTextBuffer(Zone* zone, intptr_t initial_capacity);
+ ~ZoneTextBuffer() {}
+
+ intptr_t Printf(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+ void AddString(const char* s);
+
+ char* buffer() { return buffer_; }
+ intptr_t length() { return length_; }
+
+ private:
+ void EnsureCapacity(intptr_t len);
+ Zone* zone_;
+ char* buffer_;
+ intptr_t length_;
+ intptr_t capacity_;
+};
+
+} // namespace dart
+
+#endif // RUNTIME_VM_ZONE_TEXT_BUFFER_H_
« no previous file with comments | « runtime/vm/vm_sources.gypi ('k') | runtime/vm/zone_text_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698