mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
More automatic memory handling. (nw)
This commit is contained in:
parent
ef7d6d98d8
commit
f35ba3f5fd
@ -100,7 +100,7 @@ void netlist_mame_analog_output_t::custom_netlist_additions(netlist::setup_t &se
|
||||
pstring dname = "OUT_" + m_in;
|
||||
m_delegate.bind_relative_to(owner()->machine().root_device());
|
||||
|
||||
NETLIB_NAME(analog_callback) *dev = palloc(NETLIB_NAME(analog_callback)(setup.netlist(), setup.build_fqn(dname)));
|
||||
auto dev = std::make_shared<NETLIB_NAME(analog_callback)>(setup.netlist(), setup.build_fqn(dname));
|
||||
setup.register_dev(dev);
|
||||
dev->register_callback(m_delegate);
|
||||
setup.register_link(dname + ".IN", m_in);
|
||||
@ -399,9 +399,8 @@ ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::check_mame_abort_slice()
|
||||
|
||||
ATTR_COLD void netlist_mame_device_t::save_state()
|
||||
{
|
||||
for (int i=0; i< netlist().save_list().size(); i++)
|
||||
for (auto const & s : netlist().save_list())
|
||||
{
|
||||
pstate_entry_t *s = netlist().save_list()[i];
|
||||
netlist().log().debug("saving state for {1}\n", s->m_name.cstr());
|
||||
switch (s->m_dt)
|
||||
{
|
||||
|
@ -38,9 +38,9 @@ public:
|
||||
m_R_high = 130.0;
|
||||
m_is_static = true;
|
||||
}
|
||||
virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *proxied) const override
|
||||
virtual std::shared_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *proxied) const override
|
||||
{
|
||||
return palloc(devices::nld_d_to_a_proxy(anetlist, name, proxied));
|
||||
return std::make_shared<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
|
||||
}
|
||||
};
|
||||
|
||||
@ -59,9 +59,9 @@ public:
|
||||
m_R_high = 10.0;
|
||||
m_is_static = true;
|
||||
}
|
||||
virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *proxied) const override
|
||||
virtual std::shared_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *proxied) const override
|
||||
{
|
||||
return palloc(devices::nld_d_to_a_proxy(anetlist, name, proxied));
|
||||
return std::make_shared<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
|
||||
}
|
||||
};
|
||||
|
||||
@ -213,7 +213,8 @@ netlist_t::~netlist_t()
|
||||
{
|
||||
|
||||
m_nets.clear();
|
||||
m_devices.clear_and_free();
|
||||
m_devices.clear();
|
||||
//m_devices.clear_and_free();
|
||||
|
||||
pfree(m_lib);
|
||||
pstring::resetmem();
|
||||
@ -254,8 +255,8 @@ ATTR_COLD void netlist_t::start()
|
||||
m_use_deactivate = (m_params->m_use_deactivate.Value() ? true : false);
|
||||
|
||||
log().debug("Initializing devices ...\n");
|
||||
for (device_t *dev : m_devices)
|
||||
if (dev != m_solver && dev != m_params)
|
||||
for (auto &dev : m_devices)
|
||||
if (dev.get() != m_solver && dev.get() != m_params)
|
||||
dev->start_dev();
|
||||
|
||||
}
|
||||
@ -265,7 +266,7 @@ ATTR_COLD void netlist_t::stop()
|
||||
/* find the main clock and solver ... */
|
||||
|
||||
log().debug("Stopping all devices ...\n");
|
||||
for (device_t *dev : m_devices)
|
||||
for (auto & dev : m_devices)
|
||||
dev->stop_dev();
|
||||
}
|
||||
|
||||
@ -312,7 +313,7 @@ ATTR_COLD void netlist_t::reset()
|
||||
|
||||
// FIXME: some const devices rely on this
|
||||
/* make sure params are set now .. */
|
||||
for (device_t *dev : m_devices)
|
||||
for (auto & dev : m_devices)
|
||||
{
|
||||
dev->update_param();
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ namespace netlist
|
||||
public:
|
||||
logic_family_desc_t() : m_is_static(false) {}
|
||||
virtual ~logic_family_desc_t() {}
|
||||
virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(netlist_t &anetlist, const pstring &name,
|
||||
virtual std::shared_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_t &anetlist, const pstring &name,
|
||||
logic_output_t *proxied) const = 0;
|
||||
|
||||
nl_double m_low_thresh_V;
|
||||
@ -1229,9 +1229,9 @@ namespace netlist
|
||||
ATTR_COLD pvector_t<_device_class *> get_device_list()
|
||||
{
|
||||
pvector_t<_device_class *> tmp;
|
||||
for (std::size_t i = 0; i < m_devices.size(); i++)
|
||||
for (auto &d : m_devices)
|
||||
{
|
||||
_device_class *dev = dynamic_cast<_device_class *>(m_devices[i]);
|
||||
_device_class *dev = dynamic_cast<_device_class *>(d.get());
|
||||
if (dev != nullptr)
|
||||
tmp.push_back(dev);
|
||||
}
|
||||
@ -1241,9 +1241,9 @@ namespace netlist
|
||||
template<class _device_class>
|
||||
ATTR_COLD _device_class *get_first_device()
|
||||
{
|
||||
for (std::size_t i = 0; i < m_devices.size(); i++)
|
||||
for (auto &d : m_devices)
|
||||
{
|
||||
_device_class *dev = dynamic_cast<_device_class *>(m_devices[i]);
|
||||
_device_class *dev = dynamic_cast<_device_class *>(d.get());
|
||||
if (dev != nullptr)
|
||||
return dev;
|
||||
}
|
||||
@ -1254,9 +1254,9 @@ namespace netlist
|
||||
ATTR_COLD _device_class *get_single_device(const char *classname)
|
||||
{
|
||||
_device_class *ret = nullptr;
|
||||
for (std::size_t i = 0; i < m_devices.size(); i++)
|
||||
for (auto &d : m_devices)
|
||||
{
|
||||
_device_class *dev = dynamic_cast<_device_class *>(m_devices[i]);
|
||||
_device_class *dev = dynamic_cast<_device_class *>(d.get());
|
||||
if (dev != nullptr)
|
||||
{
|
||||
if (ret != nullptr)
|
||||
@ -1268,7 +1268,7 @@ namespace netlist
|
||||
return ret;
|
||||
}
|
||||
|
||||
pvector_t<device_t *> m_devices;
|
||||
pvector_t<std::shared_ptr<device_t>> m_devices;
|
||||
net_t::list_t m_nets;
|
||||
#if (NL_KEEP_STATISTICS)
|
||||
pvector_t<core_device_t *> m_started_devices;
|
||||
|
@ -71,10 +71,10 @@ void factory_list_t::error(const pstring &s)
|
||||
m_setup.log().fatal("{1}", s);
|
||||
}
|
||||
|
||||
device_t *factory_list_t::new_device_by_name(const pstring &devname, netlist_t &anetlist, const pstring &name)
|
||||
std::shared_ptr<device_t> factory_list_t::new_device_by_name(const pstring &devname, netlist_t &anetlist, const pstring &name)
|
||||
{
|
||||
base_factory_t *f = factory_by_name(devname);
|
||||
return f->Create(anetlist, name);
|
||||
return std::shared_ptr<device_t>(f->Create(anetlist, name));
|
||||
}
|
||||
|
||||
base_factory_t * factory_list_t::factory_by_name(const pstring &devname)
|
||||
|
@ -83,7 +83,7 @@ namespace netlist
|
||||
|
||||
//ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const;
|
||||
// FIXME: legacy, should use factory_by_name
|
||||
device_t *new_device_by_name(const pstring &devname, netlist_t &anetlist, const pstring &name);
|
||||
std::shared_ptr<device_t> new_device_by_name(const pstring &devname, netlist_t &anetlist, const pstring &name);
|
||||
base_factory_t * factory_by_name(const pstring &devname);
|
||||
|
||||
private:
|
||||
|
@ -99,7 +99,7 @@ void setup_t::namespace_pop()
|
||||
}
|
||||
|
||||
|
||||
void setup_t::register_dev(device_t *dev)
|
||||
void setup_t::register_dev(std::shared_ptr<device_t> dev)
|
||||
{
|
||||
for (auto & d : netlist().m_devices)
|
||||
if (d->name() == dev->name())
|
||||
@ -126,17 +126,10 @@ void setup_t::register_dev(const pstring &classname, const pstring &name)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
device_t *dev = factory().new_device_by_name(classname, netlist(), build_fqn(name));
|
||||
if (dev == nullptr)
|
||||
log().fatal("Class {1} not found!\n", classname);
|
||||
register_dev(dev);
|
||||
#else
|
||||
auto f = factory().factory_by_name(classname);
|
||||
if (f == nullptr)
|
||||
log().fatal("Class {1} not found!\n", classname);
|
||||
m_device_factory.push_back(std::pair<pstring, base_factory_t *>(build_fqn(name), f));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -503,11 +496,11 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
|
||||
{
|
||||
// create a new one ...
|
||||
pstring x = pfmt("proxy_da_{1}_{2}")(out.name())(m_proxy_cnt);
|
||||
devices::nld_base_d_to_a_proxy *new_proxy =
|
||||
auto new_proxy =
|
||||
out_cast.logic_family()->create_d_a_proxy(netlist(), x, &out_cast);
|
||||
m_proxy_cnt++;
|
||||
|
||||
register_dev(new_proxy);
|
||||
register_dev_s(new_proxy);
|
||||
new_proxy->start_dev();
|
||||
|
||||
/* connect all existing terminals to new net */
|
||||
@ -521,8 +514,8 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
|
||||
out.net().m_core_terms.clear(); // clear the list
|
||||
|
||||
out.net().register_con(new_proxy->in());
|
||||
out_cast.set_proxy(new_proxy);
|
||||
proxy = new_proxy;
|
||||
out_cast.set_proxy(new_proxy.get());
|
||||
proxy = new_proxy.get();
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
@ -533,11 +526,11 @@ void setup_t::connect_input_output(core_terminal_t &in, core_terminal_t &out)
|
||||
{
|
||||
logic_input_t &incast = dynamic_cast<logic_input_t &>(in);
|
||||
pstring x = pfmt("proxy_ad_{1}_{2}")(in.name())( m_proxy_cnt);
|
||||
devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(netlist(), x, &incast));
|
||||
incast.set_proxy(proxy);
|
||||
auto proxy = std::make_shared<devices::nld_a_to_d_proxy>(netlist(), x, &incast);
|
||||
incast.set_proxy(proxy.get());
|
||||
m_proxy_cnt++;
|
||||
|
||||
register_dev(proxy);
|
||||
register_dev_s(proxy);
|
||||
proxy->start_dev();
|
||||
|
||||
proxy->m_Q.net().register_con(in);
|
||||
@ -572,11 +565,11 @@ void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp)
|
||||
logic_input_t &incast = dynamic_cast<logic_input_t &>(inp);
|
||||
log().debug("connect_terminal_input: connecting proxy\n");
|
||||
pstring x = pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt);
|
||||
devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(netlist(), x, &incast));
|
||||
incast.set_proxy(proxy);
|
||||
auto proxy = std::make_shared<devices::nld_a_to_d_proxy>(netlist(), x, &incast);
|
||||
incast.set_proxy(proxy.get());
|
||||
m_proxy_cnt++;
|
||||
|
||||
register_dev(proxy);
|
||||
register_dev_s(proxy);
|
||||
proxy->start_dev();
|
||||
|
||||
connect_terminals(term, proxy->m_I);
|
||||
@ -820,7 +813,7 @@ void setup_t::resolve_inputs()
|
||||
// FIXME: doesn't find internal devices. This needs to be more clever
|
||||
for (std::size_t i=0; i < netlist().m_devices.size(); i++)
|
||||
{
|
||||
devices::NETLIB_NAME(twoterm) *t = dynamic_cast<devices::NETLIB_NAME(twoterm) *>(netlist().m_devices[i]);
|
||||
devices::NETLIB_NAME(twoterm) *t = dynamic_cast<devices::NETLIB_NAME(twoterm) *>(netlist().m_devices[i].get());
|
||||
if (t != nullptr)
|
||||
{
|
||||
has_twoterms = true;
|
||||
@ -853,8 +846,8 @@ void setup_t::start_devices()
|
||||
for (pstring ll : loglist)
|
||||
{
|
||||
pstring name = "log_" + ll;
|
||||
device_t *nc = factory().new_device_by_name("LOG", netlist(), name);
|
||||
register_dev(nc);
|
||||
auto nc = factory().new_device_by_name("LOG", netlist(), name);
|
||||
register_dev_s(nc);
|
||||
register_link(name + ".I", ll);
|
||||
log().debug(" dynamic link {1}: <{2}>\n",ll, name);
|
||||
}
|
||||
@ -864,8 +857,8 @@ void setup_t::start_devices()
|
||||
|
||||
for (auto & e : m_device_factory)
|
||||
{
|
||||
device_t *dev = e.second->Create(netlist(), e.first);
|
||||
register_dev(dev);
|
||||
auto dev = std::shared_ptr<device_t>(e.second->Create(netlist(), e.first));
|
||||
register_dev_s(dev);
|
||||
}
|
||||
|
||||
netlist().start();
|
||||
@ -879,10 +872,10 @@ class logic_family_std_proxy_t : public logic_family_desc_t
|
||||
{
|
||||
public:
|
||||
logic_family_std_proxy_t() { }
|
||||
virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(netlist_t &anetlist,
|
||||
virtual std::shared_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_t &anetlist,
|
||||
const pstring &name, logic_output_t *proxied) const override
|
||||
{
|
||||
return palloc(devices::nld_d_to_a_proxy(anetlist, name, proxied));
|
||||
return std::make_shared<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#ifndef NLSETUP_H_
|
||||
#define NLSETUP_H_
|
||||
|
||||
#include <memory>
|
||||
#include "nl_base.h"
|
||||
#include "nl_factory.h"
|
||||
|
||||
@ -111,7 +112,15 @@ namespace netlist
|
||||
pstring build_fqn(const pstring &obj_name) const;
|
||||
|
||||
void register_object(device_t &dev, const pstring &name, object_t &obj);
|
||||
void register_dev(device_t *dev);
|
||||
|
||||
template<class C>
|
||||
void register_dev_s(std::shared_ptr<C> dev)
|
||||
{
|
||||
register_dev(std::static_pointer_cast<device_t>(dev));
|
||||
}
|
||||
|
||||
|
||||
void register_dev(std::shared_ptr<device_t> dev);
|
||||
void register_dev(const pstring &classname, const pstring &name);
|
||||
|
||||
void register_lib_entry(const pstring &name);
|
||||
|
@ -13,7 +13,7 @@ pstate_manager_t::pstate_manager_t()
|
||||
|
||||
pstate_manager_t::~pstate_manager_t()
|
||||
{
|
||||
m_save.clear_and_free();
|
||||
m_save.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -36,24 +36,20 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
|
||||
"DT_FLOAT"
|
||||
};
|
||||
|
||||
pstate_entry_t *p = palloc(pstate_entry_t(stname, dt, owner, size, count, ptr, is_ptr));
|
||||
m_save.push_back(p);
|
||||
auto p = std::make_unique<pstate_entry_t>(stname, dt, owner, size, count, ptr, is_ptr);
|
||||
m_save.push_back(std::move(p));
|
||||
}
|
||||
|
||||
ATTR_COLD void pstate_manager_t::remove_save_items(const void *owner)
|
||||
{
|
||||
pstate_entry_t::list_t todelete;
|
||||
|
||||
for (std::size_t i=0; i < m_save.size(); i++)
|
||||
unsigned i = 0;
|
||||
while (i < m_save.size())
|
||||
{
|
||||
if (m_save[i]->m_owner == owner)
|
||||
todelete.push_back(m_save[i]);
|
||||
m_save.remove_at(i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
for (std::size_t i=0; i < todelete.size(); i++)
|
||||
{
|
||||
m_save.remove(todelete[i]);
|
||||
}
|
||||
todelete.clear_and_free();
|
||||
}
|
||||
|
||||
ATTR_COLD void pstate_manager_t::pre_save()
|
||||
@ -74,7 +70,7 @@ template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state,
|
||||
{
|
||||
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
||||
pstate_callback_t *state_p = &state;
|
||||
pstate_entry_t *p = palloc(pstate_entry_t(stname, owner, state_p));
|
||||
m_save.push_back(p);
|
||||
auto p = std::make_unique<pstate_entry_t>(stname, owner, state_p);
|
||||
m_save.push_back(std::move(p));
|
||||
state.register_state(*this, stname);
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
#ifndef PSTATE_H_
|
||||
#define PSTATE_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "plists.h"
|
||||
#include "pstring.h"
|
||||
|
||||
@ -83,7 +85,7 @@ protected:
|
||||
|
||||
struct pstate_entry_t
|
||||
{
|
||||
using list_t = pvector_t<pstate_entry_t *>;
|
||||
using list_t = pvector_t<std::unique_ptr<pstate_entry_t>>;
|
||||
|
||||
pstate_entry_t(const pstring &stname, const pstate_data_type_e dt, const void *owner,
|
||||
const int size, const int count, void *ptr, bool is_ptr)
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
template<typename Class>
|
||||
static pvector_t<int> bubble(const pvector_t<Class *> &sl)
|
||||
static pvector_t<int> bubble(const pvector_t<Class> &sl)
|
||||
{
|
||||
pvector_t<int> ret;
|
||||
for (unsigned i=0; i<sl.size(); i++)
|
||||
@ -38,7 +38,7 @@ static pvector_t<int> bubble(const pvector_t<Class *> &sl)
|
||||
void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias)
|
||||
{
|
||||
pstring pname = devname + "." + name;
|
||||
m_pins.add(pname, palloc(pin_alias_t(pname, devname + "." + alias)));
|
||||
m_pins.add(pname, std::make_unique<pin_alias_t>(pname, devname + "." + alias));
|
||||
}
|
||||
|
||||
void nl_convert_base_t::add_ext_alias(const pstring &alias)
|
||||
@ -46,7 +46,7 @@ void nl_convert_base_t::add_ext_alias(const pstring &alias)
|
||||
m_ext_alias.push_back(alias);
|
||||
}
|
||||
|
||||
void nl_convert_base_t::add_device(dev_t *dev)
|
||||
void nl_convert_base_t::add_device(std::shared_ptr<dev_t> dev)
|
||||
{
|
||||
for (auto & d : m_devs)
|
||||
if (d->name() == dev->name())
|
||||
@ -59,30 +59,31 @@ void nl_convert_base_t::add_device(dev_t *dev)
|
||||
|
||||
void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, const pstring &amodel)
|
||||
{
|
||||
add_device(palloc(dev_t(atype, aname, amodel)));
|
||||
add_device(std::make_shared<dev_t>(atype, aname, amodel));
|
||||
}
|
||||
void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, double aval)
|
||||
{
|
||||
add_device(palloc(dev_t(atype, aname, aval)));
|
||||
add_device(std::make_shared<dev_t>(atype, aname, aval));
|
||||
}
|
||||
void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname)
|
||||
{
|
||||
add_device(palloc(dev_t(atype, aname)));
|
||||
add_device(std::make_shared<dev_t>(atype, aname));
|
||||
}
|
||||
|
||||
void nl_convert_base_t::add_term(pstring netname, pstring termname)
|
||||
{
|
||||
net_t * net = nullptr;
|
||||
if (m_nets.contains(netname))
|
||||
net = m_nets[netname];
|
||||
net = m_nets[netname].get();
|
||||
else
|
||||
{
|
||||
net = palloc(net_t(netname));
|
||||
m_nets.add(netname, net);
|
||||
auto nets = std::make_shared<net_t>(netname);
|
||||
net = nets.get();
|
||||
m_nets.add(netname, nets);
|
||||
}
|
||||
|
||||
/* if there is a pin alias, translate ... */
|
||||
pin_alias_t *alias = m_pins[termname];
|
||||
pin_alias_t *alias = m_pins[termname].get();
|
||||
|
||||
if (alias != nullptr)
|
||||
net->terminals().push_back(alias->alias());
|
||||
@ -94,7 +95,7 @@ void nl_convert_base_t::dump_nl()
|
||||
{
|
||||
for (std::size_t i=0; i<m_ext_alias.size(); i++)
|
||||
{
|
||||
net_t *net = m_nets[m_ext_alias[i]];
|
||||
net_t *net = m_nets[m_ext_alias[i]].get();
|
||||
// use the first terminal ...
|
||||
out("ALIAS({}, {})\n", m_ext_alias[i].cstr(), net->terminals()[0].cstr());
|
||||
// if the aliased net only has this one terminal connected ==> don't dump
|
||||
@ -119,7 +120,7 @@ void nl_convert_base_t::dump_nl()
|
||||
// print nets
|
||||
for (std::size_t i=0; i<m_nets.size(); i++)
|
||||
{
|
||||
net_t * net = m_nets.value_at(i);
|
||||
net_t * net = m_nets.value_at(i).get();
|
||||
if (!net->is_no_export())
|
||||
{
|
||||
//printf("Net {}\n", net->name().cstr());
|
||||
@ -131,12 +132,8 @@ void nl_convert_base_t::dump_nl()
|
||||
out(")\n");
|
||||
}
|
||||
}
|
||||
m_devs.clear_and_free();
|
||||
for (std::size_t i = 0; i < m_nets.size(); i++)
|
||||
pfree(m_nets.value_at(i));
|
||||
m_devs.clear();
|
||||
m_nets.clear();
|
||||
for (std::size_t i = 0; i < m_pins.size(); i++)
|
||||
pfree(m_pins.value_at(i));
|
||||
m_pins.clear();
|
||||
m_ext_alias.clear();
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#ifndef NL_CONVERT_H_
|
||||
#define NL_CONVERT_H_
|
||||
|
||||
#include <memory>
|
||||
#include "plib/pstring.h"
|
||||
#include "plib/plists.h"
|
||||
#include "plib/pparser.h"
|
||||
@ -25,12 +26,8 @@ public:
|
||||
nl_convert_base_t() : out(m_buf) {};
|
||||
virtual ~nl_convert_base_t()
|
||||
{
|
||||
for (std::size_t i = 0; i < m_nets.size(); i++)
|
||||
pfree(m_nets.value_at(i));
|
||||
m_nets.clear();
|
||||
m_devs.clear_and_free();
|
||||
for (std::size_t i = 0; i < m_pins.size(); i++)
|
||||
pfree(m_pins.value_at(i));
|
||||
m_devs.clear();
|
||||
m_pins.clear();
|
||||
}
|
||||
|
||||
@ -129,14 +126,14 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
void add_device(dev_t *dev);
|
||||
void add_device(std::shared_ptr<dev_t> dev);
|
||||
|
||||
postringstream m_buf;
|
||||
|
||||
pvector_t<dev_t *> m_devs;
|
||||
phashmap_t<pstring, net_t *> m_nets;
|
||||
pvector_t<std::shared_ptr<dev_t>> m_devs;
|
||||
phashmap_t<pstring, std::shared_ptr<net_t> > m_nets;
|
||||
pvector_t<pstring> m_ext_alias;
|
||||
phashmap_t<pstring, pin_alias_t *> m_pins;
|
||||
phashmap_t<pstring, std::shared_ptr<pin_alias_t>> m_pins;
|
||||
|
||||
static unit_t m_units[];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user