OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 | 1035 |
1036 | 1036 |
1037 DART_EXPORT bool Dart_HasLivePorts() { | 1037 DART_EXPORT bool Dart_HasLivePorts() { |
1038 Isolate* isolate = Isolate::Current(); | 1038 Isolate* isolate = Isolate::Current(); |
1039 ASSERT(isolate); | 1039 ASSERT(isolate); |
1040 return isolate->message_handler()->HasLivePorts(); | 1040 return isolate->message_handler()->HasLivePorts(); |
1041 } | 1041 } |
1042 | 1042 |
1043 | 1043 |
1044 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { | 1044 static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { |
1045 return Utils::Realloc(ptr, old_size, new_size); | 1045 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); |
| 1046 return reinterpret_cast<uint8_t*>(new_ptr); |
1046 } | 1047 } |
1047 | 1048 |
1048 | 1049 |
1049 DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id, | 1050 DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id, |
1050 intptr_t len, | 1051 intptr_t len, |
1051 intptr_t* data) { | 1052 intptr_t* data) { |
1052 uint8_t* buffer = NULL; | 1053 uint8_t* buffer = NULL; |
1053 ApiMessageWriter writer(&buffer, &allocator); | 1054 ApiMessageWriter writer(&buffer, &allocator); |
1054 writer.WriteMessage(len, data); | 1055 writer.WriteMessage(len, data); |
1055 | 1056 |
(...skipping 3780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4836 } | 4837 } |
4837 { | 4838 { |
4838 NoGCScope no_gc; | 4839 NoGCScope no_gc; |
4839 RawObject* raw_obj = obj.raw(); | 4840 RawObject* raw_obj = obj.raw(); |
4840 isolate->heap()->SetPeer(raw_obj, peer); | 4841 isolate->heap()->SetPeer(raw_obj, peer); |
4841 } | 4842 } |
4842 return Api::Success(); | 4843 return Api::Success(); |
4843 } | 4844 } |
4844 | 4845 |
4845 } // namespace dart | 4846 } // namespace dart |
OLD | NEW |