From 88ce545cdda64659894b87fc0b98e1b044eea3e0 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 18 Nov 2019 05:08:36 +1100 Subject: misc cleanup: * Got rid of some more simple_list in core debugger code * Fixed a buffer overrun in wavwrite (buffer half requried size) * Slightly reduced dependencies and overhead in wavwrite * Made new disassembly windows in Qt debugger default to current CPU --- src/emu/debug/dvmemory.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/emu/debug/dvmemory.cpp') diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 293d1082fc0..282f6a14f3a 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -119,7 +119,7 @@ debug_view_memory::debug_view_memory(running_machine &machine, debug_view_osd_up // fail if no available sources enumerate_sources(); - if (m_source_list.count() == 0) + if (m_source_list.empty()) throw std::bad_alloc(); // configure the view @@ -135,7 +135,7 @@ debug_view_memory::debug_view_memory(running_machine &machine, debug_view_osd_up void debug_view_memory::enumerate_sources() { // start with an empty list - m_source_list.reset(); + m_source_list.clear(); std::string name; // first add all the devices' address spaces @@ -145,14 +145,14 @@ void debug_view_memory::enumerate_sources() { address_space &space = memintf.space(spacenum); name = string_format("%s '%s' %s space memory", memintf.device().name(), memintf.device().tag(), space.name()); - m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), space))); + m_source_list.emplace_back(std::make_unique(name.c_str(), space)); } // then add all the memory regions for (auto ®ion : machine().memory().regions()) { name = string_format("Region '%s'", region.second->name()); - m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region.second.get()))); + m_source_list.emplace_back(std::make_unique(name.c_str(), *region.second.get())); } // finally add all global array symbols in alphabetical order @@ -174,10 +174,11 @@ void debug_view_memory::enumerate_sources() std::sort(itemnames.begin(), itemnames.end(), [] (auto const &x, auto const &y) { return std::get<0>(x) < std::get<0>(y); }); for (auto const &item : itemnames) - m_source_list.append(*global_alloc(debug_view_memory_source(std::get<0>(item).c_str(), std::get<1>(item), std::get<2>(item), std::get<3>(item)))); + m_source_list.emplace_back(std::make_unique(std::get<0>(item).c_str(), std::get<1>(item), std::get<2>(item), std::get<3>(item))); // reset the source to a known good entry - set_source(*m_source_list.first()); + if (!m_source_list.empty()) + set_source(*m_source_list[0]); } -- cgit v1.2.3