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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 16271010: Use 'new' in all the snapshot reallocation functions instead of realloc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
OLDNEW
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
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 void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); 1045 return Utils::Realloc(ptr, old_size, new_size);
1046 return reinterpret_cast<uint8_t*>(new_ptr);
1047 } 1046 }
1048 1047
1049 1048
1050 DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id, 1049 DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id,
1051 intptr_t len, 1050 intptr_t len,
1052 intptr_t* data) { 1051 intptr_t* data) {
1053 uint8_t* buffer = NULL; 1052 uint8_t* buffer = NULL;
1054 ApiMessageWriter writer(&buffer, &allocator); 1053 ApiMessageWriter writer(&buffer, &allocator);
1055 writer.WriteMessage(len, data); 1054 writer.WriteMessage(len, data);
1056 1055
(...skipping 3780 matching lines...) Expand 10 before | Expand all | Expand 10 after
4837 } 4836 }
4838 { 4837 {
4839 NoGCScope no_gc; 4838 NoGCScope no_gc;
4840 RawObject* raw_obj = obj.raw(); 4839 RawObject* raw_obj = obj.raw();
4841 isolate->heap()->SetPeer(raw_obj, peer); 4840 isolate->heap()->SetPeer(raw_obj, peer);
4842 } 4841 }
4843 return Api::Success(); 4842 return Api::Success();
4844 } 4843 }
4845 4844
4846 } // namespace dart 4845 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698