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

Side by Side Diff: runtime/vm/dart_api_message.h

Issue 10557043: - Avoid doubling 0 when trying to determine a new size for the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/dart_api_message.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 #ifndef VM_DART_API_MESSAGE_H_ 5 #ifndef VM_DART_API_MESSAGE_H_
6 #define VM_DART_API_MESSAGE_H_ 6 #define VM_DART_API_MESSAGE_H_
7 7
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/snapshot.h" 9 #include "vm/snapshot.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 111
112 class ApiMessageWriter : public BaseWriter { 112 class ApiMessageWriter : public BaseWriter {
113 public: 113 public:
114 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) 114 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc)
115 : BaseWriter(buffer, alloc), object_id_(0), 115 : BaseWriter(buffer, alloc), object_id_(0),
116 forward_list_(NULL), forward_list_length_(0), forward_id_(0) { 116 forward_list_(NULL), forward_list_length_(0), forward_id_(0) {
117 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); 117 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1);
118 } 118 }
119 ~ApiMessageWriter() { 119 ~ApiMessageWriter() {
120 delete forward_list_; 120 ::free(forward_list_);
121 } 121 }
122 122
123 // Writes a message of integers. 123 // Writes a message of integers.
124 void WriteMessage(intptr_t field_count, intptr_t *data); 124 void WriteMessage(intptr_t field_count, intptr_t *data);
125 125
126 void WriteCMessage(Dart_CObject* object); 126 void WriteCMessage(Dart_CObject* object);
127 127
128 void FinalizeBuffer() { 128 void FinalizeBuffer() {
129 BaseWriter::FinalizeBuffer(Snapshot::kMessage); 129 BaseWriter::FinalizeBuffer(Snapshot::kMessage);
130 } 130 }
(...skipping 25 matching lines...) Expand all
156 Dart_CObject** forward_list_; 156 Dart_CObject** forward_list_;
157 intptr_t forward_list_length_; 157 intptr_t forward_list_length_;
158 intptr_t forward_id_; 158 intptr_t forward_id_;
159 159
160 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); 160 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter);
161 }; 161 };
162 162
163 } // namespace dart 163 } // namespace dart
164 164
165 #endif // VM_DART_API_MESSAGE_H_ 165 #endif // VM_DART_API_MESSAGE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698