Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
zone_text_buffer.h
Go to the documentation of this file.
1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_ZONE_TEXT_BUFFER_H_
6#define RUNTIME_VM_ZONE_TEXT_BUFFER_H_
7
9#include "vm/allocation.h"
10#include "vm/globals.h"
11
12namespace dart {
13
14class String;
15class Zone;
16
17// ZoneTextBuffer allocates the character buffer in the given zone. Thus,
18// pointers returned by buffer() have the same lifetime as the zone.
20 public:
21 explicit ZoneTextBuffer(Zone* zone, intptr_t initial_capacity = 64);
23
24 // Allocates a new internal buffer. Thus, the contents of buffers returned by
25 // previous calls to buffer() are no longer affected by this object.
26 void Clear();
27
28 private:
29 bool EnsureCapacity(intptr_t len);
30 Zone* zone_;
31
33};
34
35} // namespace dart
36
37#endif // RUNTIME_VM_ZONE_TEXT_BUFFER_H_
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition globals.h:581