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

Side by Side Diff: vm/dart_api_message.h

Issue 10908185: Do not allocate a buffer of 64KB by default when writing a message out. Start (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 | vm/datastream.h » ('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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 ReAlloc alloc_; 105 ReAlloc alloc_;
106 ApiGrowableArray<BackRefNode*> backward_references_; 106 ApiGrowableArray<BackRefNode*> backward_references_;
107 107
108 Dart_CObject type_arguments_marker; 108 Dart_CObject type_arguments_marker;
109 Dart_CObject dynamic_type_marker; 109 Dart_CObject dynamic_type_marker;
110 }; 110 };
111 111
112 112
113 class ApiMessageWriter : public BaseWriter { 113 class ApiMessageWriter : public BaseWriter {
114 public: 114 public:
115 static const intptr_t kIncrementSize = 512;
115 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc) 116 ApiMessageWriter(uint8_t** buffer, ReAlloc alloc)
116 : BaseWriter(buffer, alloc), object_id_(0), 117 : BaseWriter(buffer, alloc, kIncrementSize), object_id_(0),
117 forward_list_(NULL), forward_list_length_(0), forward_id_(0) { 118 forward_list_(NULL), forward_list_length_(0), forward_id_(0) {
118 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1); 119 ASSERT(kDartCObjectTypeMask >= Dart_CObject::kNumberOfTypes - 1);
119 } 120 }
120 ~ApiMessageWriter() { 121 ~ApiMessageWriter() {
121 ::free(forward_list_); 122 ::free(forward_list_);
122 } 123 }
123 124
124 // Writes a message of integers. 125 // Writes a message of integers.
125 void WriteMessage(intptr_t field_count, intptr_t *data); 126 void WriteMessage(intptr_t field_count, intptr_t *data);
126 127
(...skipping 28 matching lines...) Expand all
155 Dart_CObject** forward_list_; 156 Dart_CObject** forward_list_;
156 intptr_t forward_list_length_; 157 intptr_t forward_list_length_;
157 intptr_t forward_id_; 158 intptr_t forward_id_;
158 159
159 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter); 160 DISALLOW_COPY_AND_ASSIGN(ApiMessageWriter);
160 }; 161 };
161 162
162 } // namespace dart 163 } // namespace dart
163 164
164 #endif // VM_DART_API_MESSAGE_H_ 165 #endif // VM_DART_API_MESSAGE_H_
OLDNEW
« no previous file with comments | « no previous file | vm/datastream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698