Flutter Engine
The Flutter Engine
isolate_data.cc
Go to the documentation of this file.
1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5#include "bin/isolate_data.h"
8
9namespace dart {
10namespace bin {
11
13 const char* packages_file,
14 AppSnapshot* app_snapshot,
15 bool isolate_run_app_snapshot)
16 : script_url((url != nullptr) ? Utils::StrDup(url) : nullptr),
17 app_snapshot_(app_snapshot),
18 resolved_packages_config_(nullptr),
19 kernel_buffer_(nullptr),
20 kernel_buffer_size_(0),
21 isolate_run_app_snapshot_(isolate_run_app_snapshot) {
22 if (packages_file != nullptr) {
23 packages_file_ = Utils::StrDup(packages_file);
24 }
25}
26
28 for (intptr_t i = 0; i < loading_units_.length(); i++) {
29 delete loading_units_[i];
30 }
31 free(script_url);
32 script_url = nullptr;
33 free(packages_file_);
34 packages_file_ = nullptr;
35 free(resolved_packages_config_);
36 resolved_packages_config_ = nullptr;
37 kernel_buffer_ = nullptr;
38 kernel_buffer_size_ = 0;
39}
40
42 : isolate_group_data_(isolate_group_data),
43 loader_(nullptr),
44 packages_file_(nullptr) {
45 if (isolate_group_data->packages_file_ != nullptr) {
46 packages_file_ = Utils::StrDup(isolate_group_data->packages_file_);
47 }
48}
49
51 free(packages_file_);
52 packages_file_ = nullptr;
53}
54
55} // namespace bin
56} // namespace dart
static char * StrDup(const char *s)
IsolateData(IsolateGroupData *isolate_group_data)
Definition: isolate_data.cc:41
IsolateGroupData * isolate_group_data() const
Definition: isolate_data.h:128
IsolateGroupData(const char *url, const char *packages_file, AppSnapshot *app_snapshot, bool isolate_run_app_snapshot)
Definition: isolate_data.cc:12
Definition: dart_vm.cc:33