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

Unified Diff: runtime/vm/isolate.cc

Issue 2654443003: Revert "VM: Fix memory leaks during isolate spawning" (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index b5a139be71e7a012a677d2f00039b1d4fe91fbe6..ca81a6303f4354ce19565fb4c5d5a41c7dabbbaa 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -2776,7 +2776,7 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
void* init_data,
const char* script_url,
const Function& func,
- SerializedObjectBuffer* message_buffer,
+ const Instance& message,
Monitor* spawn_count_monitor,
intptr_t* spawn_count,
const char* package_root,
@@ -2818,8 +2818,9 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
const String& class_name = String::Handle(cls.Name());
class_name_ = NewConstChar(class_name.ToCString());
}
- message_buffer->StealBuffer(&serialized_message_, &serialized_message_len_);
-
+ bool can_send_any_object = true;
+ SerializeObject(message, &serialized_message_, &serialized_message_len_,
+ can_send_any_object);
// Inherit flags from spawning isolate.
Isolate::Current()->FlagsCopyTo(isolate_flags());
}
@@ -2830,8 +2831,8 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
const char* script_url,
const char* package_root,
const char* package_config,
- SerializedObjectBuffer* args_buffer,
- SerializedObjectBuffer* message_buffer,
+ const Instance& args,
+ const Instance& message,
Monitor* spawn_count_monitor,
intptr_t* spawn_count,
bool paused,
@@ -2860,9 +2861,11 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
paused_(paused),
errors_are_fatal_(errors_are_fatal) {
function_name_ = NewConstChar("main");
- args_buffer->StealBuffer(&serialized_args_, &serialized_args_len_);
- message_buffer->StealBuffer(&serialized_message_, &serialized_message_len_);
-
+ bool can_send_any_object = false;
+ SerializeObject(args, &serialized_args_, &serialized_args_len_,
+ can_send_any_object);
+ SerializeObject(message, &serialized_message_, &serialized_message_len_,
+ can_send_any_object);
// By default inherit flags from spawning isolate. These can be overridden
// from the calling code.
Isolate::Current()->FlagsCopyTo(isolate_flags());
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698