| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |