From 426a33e77438f956d0890391af7bb7ed9b7a20fc Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 2 Jun 2023 12:07:22 -0700 Subject: sim_t: change plugin_devices to a vec of shared_ptrs --- spike_main/spike.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'spike_main') diff --git a/spike_main/spike.cc b/spike_main/spike.cc index 7290f38..f257582 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -336,7 +336,7 @@ int main(int argc, char** argv) bool dtb_enabled = true; const char* kernel = NULL; reg_t kernel_offset, kernel_size; - std::vector> plugin_devices; + std::vector>> plugin_devices; std::unique_ptr ic; std::unique_ptr dc; std::unique_ptr l2; @@ -416,7 +416,7 @@ int main(int argc, char** argv) std::string args(avail, '\0'); stream.readsome(&args[0], avail); - plugin_devices.emplace_back(base, new mmio_plugin_device_t(name, args)); + plugin_devices.emplace_back(base, std::make_shared(name, args)); }; option_parser_t parser; @@ -602,8 +602,5 @@ int main(int argc, char** argv) for (auto& mem : mems) delete mem.second; - for (auto& plugin_device : plugin_devices) - delete plugin_device.second; - return return_code; } -- cgit v1.1