mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
Work around GNU libstdc++ wanting to stack large temporaries when vector elements can be trivially constructed.
This commit is contained in:
parent
245ef45985
commit
58c8cba9b3
@ -264,10 +264,10 @@ before. It is created as an object of the device.
|
|||||||
|
|
||||||
[device constructor] m_view(*this, "name"),
|
[device constructor] m_view(*this, "name"),
|
||||||
|
|
||||||
It is then setup through the address map API or dynamically. The, at
|
It is then setup through the address map API or dynamically. At
|
||||||
runtime, a variant, which is numbered, can be selected through the
|
runtime, a numbered variant can be selected using the ``select`` method,
|
||||||
``select`` method or the view can be disabled through the ``disabled``
|
or the view can be disabled using the ``disable`` method. A disabled
|
||||||
method. A disabled view can be reenabled at any time.
|
view can be re-enabled at any time.
|
||||||
|
|
||||||
|
|
||||||
4. Address maps API
|
4. Address maps API
|
||||||
@ -617,9 +617,9 @@ second method to setup a view is perfectly reasonable. A view is of
|
|||||||
type **memory_view** and an indexed entry (e.g. a variant to setup) is
|
type **memory_view** and an indexed entry (e.g. a variant to setup) is
|
||||||
of type **memory_view::memory_view_entry &**.
|
of type **memory_view::memory_view_entry &**.
|
||||||
|
|
||||||
A view can be installed in another view, but don't forget that a view
|
A view can be installed in another view, but don’t forget that a view
|
||||||
can be installed only once. A view can also being part of "what was
|
can be installed only once. A view can also be part of “what was there
|
||||||
there before".
|
before”.
|
||||||
|
|
||||||
|
|
||||||
5. Address space dynamic mapping API
|
5. Address space dynamic mapping API
|
||||||
|
@ -54,10 +54,30 @@ private:
|
|||||||
static constexpr offs_t HIGHMASK = make_bitmask<offs_t>(HighBits) ^ LOWMASK;
|
static constexpr offs_t HIGHMASK = make_bitmask<offs_t>(HighBits) ^ LOWMASK;
|
||||||
static constexpr offs_t UPMASK = ~make_bitmask<offs_t>(HighBits);
|
static constexpr offs_t UPMASK = ~make_bitmask<offs_t>(HighBits);
|
||||||
|
|
||||||
|
class handler_array : public std::array<handler_entry_read<Width, AddrShift, Endian> *, COUNT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using std::array<handler_entry_read<Width, AddrShift, Endian> *, COUNT>::array;
|
||||||
|
handler_array()
|
||||||
|
{
|
||||||
|
std::fill(this->begin(), this->end(), nullptr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class range_array : public std::array<handler_entry::range, COUNT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using std::array<handler_entry::range, COUNT>::array;
|
||||||
|
range_array()
|
||||||
|
{
|
||||||
|
std::fill(this->begin(), this->end(), handler_entry::range{ 0, 0 });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
memory_view *m_view;
|
memory_view *m_view;
|
||||||
|
|
||||||
std::vector<std::array<handler_entry_read<Width, AddrShift, Endian> *, COUNT>> m_dispatch_array;
|
std::vector<handler_array> m_dispatch_array;
|
||||||
std::vector<std::array<handler_entry::range, COUNT>> m_ranges_array;
|
std::vector<range_array> m_ranges_array;
|
||||||
|
|
||||||
handler_entry_read<Width, AddrShift, Endian> **m_a_dispatch;
|
handler_entry_read<Width, AddrShift, Endian> **m_a_dispatch;
|
||||||
handler_entry::range *m_a_ranges;
|
handler_entry::range *m_a_ranges;
|
||||||
|
@ -600,7 +600,7 @@ template<int HighBits, int Width, int AddrShift, endianness_t Endian> void handl
|
|||||||
if(i > m_dispatch_array.size())
|
if(i > m_dispatch_array.size())
|
||||||
fatalerror("out-of-range view update selection.");
|
fatalerror("out-of-range view update selection.");
|
||||||
else if(i == m_dispatch_array.size()) {
|
else if(i == m_dispatch_array.size()) {
|
||||||
u32 aid = (std::array<handler_entry_read<Width, AddrShift, Endian> *, COUNT> *)(m_a_dispatch) - m_dispatch_array.data();
|
u32 aid = (handler_array *)(m_a_dispatch) - m_dispatch_array.data();
|
||||||
|
|
||||||
m_dispatch_array.resize(i+1);
|
m_dispatch_array.resize(i+1);
|
||||||
m_ranges_array.resize(i+1);
|
m_ranges_array.resize(i+1);
|
||||||
|
@ -54,10 +54,30 @@ private:
|
|||||||
static constexpr offs_t HIGHMASK = make_bitmask<offs_t>(HighBits) ^ LOWMASK;
|
static constexpr offs_t HIGHMASK = make_bitmask<offs_t>(HighBits) ^ LOWMASK;
|
||||||
static constexpr offs_t UPMASK = ~make_bitmask<offs_t>(HighBits);
|
static constexpr offs_t UPMASK = ~make_bitmask<offs_t>(HighBits);
|
||||||
|
|
||||||
|
class handler_array : public std::array<handler_entry_write<Width, AddrShift, Endian> *, COUNT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using std::array<handler_entry_write<Width, AddrShift, Endian> *, COUNT>::array;
|
||||||
|
handler_array()
|
||||||
|
{
|
||||||
|
std::fill(this->begin(), this->end(), nullptr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class range_array : public std::array<handler_entry::range, COUNT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using std::array<handler_entry::range, COUNT>::array;
|
||||||
|
range_array()
|
||||||
|
{
|
||||||
|
std::fill(this->begin(), this->end(), handler_entry::range{ 0, 0 });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
memory_view *m_view;
|
memory_view *m_view;
|
||||||
|
|
||||||
std::vector<std::array<handler_entry_write<Width, AddrShift, Endian> *, COUNT>> m_dispatch_array;
|
std::vector<handler_array> m_dispatch_array;
|
||||||
std::vector<std::array<handler_entry::range, COUNT>> m_ranges_array;
|
std::vector<range_array> m_ranges_array;
|
||||||
|
|
||||||
handler_entry_write<Width, AddrShift, Endian> **m_a_dispatch;
|
handler_entry_write<Width, AddrShift, Endian> **m_a_dispatch;
|
||||||
handler_entry::range *m_a_ranges;
|
handler_entry::range *m_a_ranges;
|
||||||
|
@ -606,7 +606,7 @@ template<int HighBits, int Width, int AddrShift, endianness_t Endian> void handl
|
|||||||
if(i > m_dispatch_array.size())
|
if(i > m_dispatch_array.size())
|
||||||
fatalerror("out-of-range view update selection.");
|
fatalerror("out-of-range view update selection.");
|
||||||
else if(i == m_dispatch_array.size()) {
|
else if(i == m_dispatch_array.size()) {
|
||||||
u32 aid = (std::array<handler_entry_write<Width, AddrShift, Endian> *, COUNT> *)(m_a_dispatch) - m_dispatch_array.data();
|
u32 aid = (handler_array *)(m_a_dispatch) - m_dispatch_array.data();
|
||||||
|
|
||||||
m_dispatch_array.resize(i+1);
|
m_dispatch_array.resize(i+1);
|
||||||
m_ranges_array.resize(i+1);
|
m_ranges_array.resize(i+1);
|
||||||
|
Loading…
Reference in New Issue
Block a user