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

Side by Side Diff: runtime/lib/string_buffer_patch.dart

Issue 25790004: - Fix typos and add comments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/coverage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class StringBuffer { 5 patch class StringBuffer {
6 static const int _BUFFER_SIZE = 64; 6 static const int _BUFFER_SIZE = 64;
7 static const int _PARTS_TO_COMPACT = 128; 7 static const int _PARTS_TO_COMPACT = 128;
8 static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8; 8 static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8;
9 9
10 /** 10 /**
(...skipping 14 matching lines...) Expand all
25 * cost that comes from the per-object memory overhead. We keep track 25 * cost that comes from the per-object memory overhead. We keep track
26 * of the last index where we ended our compaction and the number of 26 * of the last index where we ended our compaction and the number of
27 * code units added since the last compaction. 27 * code units added since the last compaction.
28 */ 28 */
29 int _partsCompactionIndex = 0; 29 int _partsCompactionIndex = 0;
30 int _partsCodeUnitsSinceCompaction = 0; 30 int _partsCodeUnitsSinceCompaction = 0;
31 _ObjectArray _partsCompactionArray = null; 31 _ObjectArray _partsCompactionArray = null;
32 32
33 /** 33 /**
34 * The buffer is used to build up a string from code units. It is 34 * The buffer is used to build up a string from code units. It is
35 * used when writing short strings or individul char codes to the 35 * used when writing short strings or individual char codes to the
36 * buffer. The buffer is allocated on demand. 36 * buffer. The buffer is allocated on demand.
37 */ 37 */
38 Uint16List _buffer = null; 38 Uint16List _buffer = null;
39 int _bufferPosition = 0; 39 int _bufferPosition = 0;
40 40
41 /** 41 /**
42 * Collects the approximate maximal magnitude of the code units added 42 * Collects the approximate maximal magnitude of the code units added
43 * to the buffer. 43 * to the buffer.
44 * 44 *
45 * The value of each added code unit is or'ed with this variable, so the 45 * The value of each added code unit is or'ed with this variable, so the
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 _partsCodeUnitsSinceCompaction = 0; 176 _partsCodeUnitsSinceCompaction = 0;
177 _partsCompactionIndex = _parts.length; 177 _partsCompactionIndex = _parts.length;
178 } 178 }
179 179
180 /** 180 /**
181 * Create a [String] from the UFT-16 code units in buffer. 181 * Create a [String] from the UFT-16 code units in buffer.
182 */ 182 */
183 static String _create(Uint16List buffer, int length, bool isLatin1) 183 static String _create(Uint16List buffer, int length, bool isLatin1)
184 native "StringBuffer_createStringFromUint16Array"; 184 native "StringBuffer_createStringFromUint16Array";
185 } 185 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/coverage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698