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

Unified Diff: runtime/vm/isolate.cc

Issue 2649283003: Reland "VM: Fix memory leaks during isolate spawning" (Closed)
Patch Set: Fix bug 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
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index ca81a6303f4354ce19565fb4c5d5a41c7dabbbaa..b5a139be71e7a012a677d2f00039b1d4fe91fbe6 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,
- const Instance& message,
+ SerializedObjectBuffer* message_buffer,
Monitor* spawn_count_monitor,
intptr_t* spawn_count,
const char* package_root,
@@ -2818,9 +2818,8 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
const String& class_name = String::Handle(cls.Name());
class_name_ = NewConstChar(class_name.ToCString());
}
- bool can_send_any_object = true;
- SerializeObject(message, &serialized_message_, &serialized_message_len_,
- can_send_any_object);
+ message_buffer->StealBuffer(&serialized_message_, &serialized_message_len_);
+
// Inherit flags from spawning isolate.
Isolate::Current()->FlagsCopyTo(isolate_flags());
}
@@ -2831,8 +2830,8 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
const char* script_url,
const char* package_root,
const char* package_config,
- const Instance& args,
- const Instance& message,
+ SerializedObjectBuffer* args_buffer,
+ SerializedObjectBuffer* message_buffer,
Monitor* spawn_count_monitor,
intptr_t* spawn_count,
bool paused,
@@ -2861,11 +2860,9 @@ IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
paused_(paused),
errors_are_fatal_(errors_are_fatal) {
function_name_ = NewConstChar("main");
- 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);
+ args_buffer->StealBuffer(&serialized_args_, &serialized_args_len_);
+ message_buffer->StealBuffer(&serialized_message_, &serialized_message_len_);
+
// 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') | runtime/vm/snapshot.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698