Ref count in flight calls when a tap is installed, plus fix for less permissive compilers [O. Galibert, smf]

This commit is contained in:
smf- 2019-10-21 09:12:07 +01:00
parent 02f39608f2
commit 6292526722
2 changed files with 12 additions and 4 deletions

View File

@ -7,8 +7,12 @@
template<int Width, int AddrShift, int Endian> typename emu::detail::handler_entry_size<Width>::uX handler_entry_read_tap<Width, AddrShift, Endian>::read(offs_t offset, uX mem_mask) template<int Width, int AddrShift, int Endian> typename emu::detail::handler_entry_size<Width>::uX handler_entry_read_tap<Width, AddrShift, Endian>::read(offs_t offset, uX mem_mask)
{ {
this->ref();
uX data = inh::m_next->read(offset, mem_mask); uX data = inh::m_next->read(offset, mem_mask);
m_tap(offset, data, mem_mask); m_tap(offset, data, mem_mask);
this->unref();
return data; return data;
} }
@ -25,8 +29,12 @@ template<int Width, int AddrShift, int Endian> handler_entry_read_tap<Width, Add
template<int Width, int AddrShift, int Endian> void handler_entry_write_tap<Width, AddrShift, Endian>::write(offs_t offset, uX data, uX mem_mask) template<int Width, int AddrShift, int Endian> void handler_entry_write_tap<Width, AddrShift, Endian>::write(offs_t offset, uX data, uX mem_mask)
{ {
this->ref();
m_tap(offset, data, mem_mask); m_tap(offset, data, mem_mask);
inh::m_next->write(offset, data, mem_mask); inh::m_next->write(offset, data, mem_mask);
this->unref();
} }
template<int Width, int AddrShift, int Endian> std::string handler_entry_write_tap<Width, AddrShift, Endian>::name() const template<int Width, int AddrShift, int Endian> std::string handler_entry_write_tap<Width, AddrShift, Endian>::name() const

View File

@ -62,7 +62,7 @@ template<int Width, int AddrShift, int Endian> void handler_entry_read_units<Wid
template<int Width, int AddrShift, int Endian> typename emu::detail::handler_entry_size<Width>::uX handler_entry_read_units<Width, AddrShift, Endian>::read(offs_t offset, uX mem_mask) template<int Width, int AddrShift, int Endian> typename emu::detail::handler_entry_size<Width>::uX handler_entry_read_units<Width, AddrShift, Endian>::read(offs_t offset, uX mem_mask)
{ {
ref(); this->ref();
uX result = m_unmap; uX result = m_unmap;
for (int index = 0; index < m_subunits; index++) { for (int index = 0; index < m_subunits; index++) {
@ -94,7 +94,7 @@ template<int Width, int AddrShift, int Endian> typename emu::detail::handler_ent
} }
} }
unref(); this->unref();
return result; return result;
} }
@ -177,7 +177,7 @@ template<int Width, int AddrShift, int Endian> void handler_entry_write_units<Wi
template<int Width, int AddrShift, int Endian> void handler_entry_write_units<Width, AddrShift, Endian>::write(offs_t offset, uX data, uX mem_mask) template<int Width, int AddrShift, int Endian> void handler_entry_write_units<Width, AddrShift, Endian>::write(offs_t offset, uX data, uX mem_mask)
{ {
ref(); this->ref();
for (int index = 0; index < m_subunits; index++) { for (int index = 0; index < m_subunits; index++) {
const subunit_info &si = m_subunit_infos[index]; const subunit_info &si = m_subunit_infos[index];
@ -208,7 +208,7 @@ template<int Width, int AddrShift, int Endian> void handler_entry_write_units<Wi
} }
} }
unref(); this->unref();
} }