| Index: runtime/vm/dart_api_impl.cc
|
| ===================================================================
|
| --- runtime/vm/dart_api_impl.cc (revision 33235)
|
| +++ runtime/vm/dart_api_impl.cc (working copy)
|
| @@ -617,6 +617,7 @@
|
| FinalizablePersistentHandles* handles,
|
| Dart_Handle object,
|
| void* peer,
|
| + intptr_t external_allocation_size,
|
| Dart_WeakPersistentHandleFinalizer callback) {
|
| ReusableObjectHandleScope reused_obj_handle(isolate);
|
| Object& ref = reused_obj_handle.Handle();
|
| @@ -625,6 +626,8 @@
|
| finalizable_ref->set_raw(ref);
|
| finalizable_ref->set_peer(peer);
|
| finalizable_ref->set_callback(callback);
|
| + finalizable_ref->InitializeExternalAllocationSize(external_allocation_size,
|
| + isolate->heap());
|
| return reinterpret_cast<Dart_WeakPersistentHandle>(finalizable_ref);
|
| }
|
|
|
| @@ -632,6 +635,7 @@
|
| DART_EXPORT Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle(
|
| Dart_Handle object,
|
| void* peer,
|
| + intptr_t external_allocation_size,
|
| Dart_WeakPersistentHandleFinalizer callback) {
|
| Isolate* isolate = Isolate::Current();
|
| CHECK_ISOLATE(isolate);
|
| @@ -641,6 +645,7 @@
|
| &state->weak_persistent_handles(),
|
| object,
|
| peer,
|
| + external_allocation_size,
|
| callback);
|
| }
|
|
|
| @@ -648,6 +653,7 @@
|
| DART_EXPORT Dart_WeakPersistentHandle Dart_NewPrologueWeakPersistentHandle(
|
| Dart_Handle object,
|
| void* peer,
|
| + intptr_t external_allocation_size,
|
| Dart_WeakPersistentHandleFinalizer callback) {
|
| Isolate* isolate = Isolate::Current();
|
| CHECK_ISOLATE(isolate);
|
| @@ -657,6 +663,7 @@
|
| &state->prologue_weak_persistent_handles(),
|
| object,
|
| peer,
|
| + external_allocation_size,
|
| callback);
|
| }
|
|
|
| @@ -1785,6 +1792,7 @@
|
| intptr_t length,
|
| void* peer,
|
| Dart_PeerFinalizer cback) {
|
| + // TODO(17284): Allocate large external data in old space.
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| if (latin1_array == NULL && length != 0) {
|
| @@ -1801,6 +1809,7 @@
|
| intptr_t length,
|
| void* peer,
|
| Dart_PeerFinalizer cback) {
|
| + // TODO(17284): Allocate large external data in old space.
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| if (utf16_array == NULL && length != 0) {
|
| @@ -2742,6 +2751,7 @@
|
| Dart_TypedData_Type type,
|
| void* data,
|
| intptr_t length) {
|
| + // TODO(17284): Allocate large external data in old space.
|
| Isolate* isolate = Isolate::Current();
|
| DARTSCOPE(isolate);
|
| if (data == NULL && length != 0) {
|
|
|