mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +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
|
||||||
|
@ -763,9 +763,9 @@ bool address_map_entry::unitmask_is_appropriate(u8 width, u64 unitmask, const ch
|
|||||||
address_map::address_map(device_t &device, int spacenum)
|
address_map::address_map(device_t &device, int spacenum)
|
||||||
: m_spacenum(spacenum),
|
: m_spacenum(spacenum),
|
||||||
m_device(&device),
|
m_device(&device),
|
||||||
m_view(nullptr),
|
m_view(nullptr),
|
||||||
m_unmapval(0),
|
m_unmapval(0),
|
||||||
m_globalmask(0)
|
m_globalmask(0)
|
||||||
{
|
{
|
||||||
// get our memory interface
|
// get our memory interface
|
||||||
const device_memory_interface *memintf;
|
const device_memory_interface *memintf;
|
||||||
@ -799,7 +799,7 @@ address_map::address_map(device_t &device, int spacenum)
|
|||||||
address_map::address_map(device_t &device, address_map_entry *entry)
|
address_map::address_map(device_t &device, address_map_entry *entry)
|
||||||
: m_spacenum(AS_PROGRAM),
|
: m_spacenum(AS_PROGRAM),
|
||||||
m_device(&device),
|
m_device(&device),
|
||||||
m_view(nullptr),
|
m_view(nullptr),
|
||||||
m_unmapval(0),
|
m_unmapval(0),
|
||||||
m_globalmask(0)
|
m_globalmask(0)
|
||||||
{
|
{
|
||||||
@ -817,7 +817,7 @@ address_map::address_map(device_t &device, address_map_entry *entry)
|
|||||||
address_map::address_map(const address_space &space, offs_t start, offs_t end, u64 unitmask, int cswidth, device_t &device, address_map_constructor submap_delegate)
|
address_map::address_map(const address_space &space, offs_t start, offs_t end, u64 unitmask, int cswidth, device_t &device, address_map_constructor submap_delegate)
|
||||||
: m_spacenum(space.spacenum()),
|
: m_spacenum(space.spacenum()),
|
||||||
m_device(&device),
|
m_device(&device),
|
||||||
m_view(nullptr),
|
m_view(nullptr),
|
||||||
m_unmapval(space.unmap()),
|
m_unmapval(space.unmap()),
|
||||||
m_globalmask(space.addrmask())
|
m_globalmask(space.addrmask())
|
||||||
{
|
{
|
||||||
|
@ -1012,7 +1012,7 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base,
|
|||||||
|
|
||||||
memory_region::memory_region(running_machine &machine, std::string name, u32 length, u8 width, endianness_t endian)
|
memory_region::memory_region(running_machine &machine, std::string name, u32 length, u8 width, endianness_t endian)
|
||||||
: m_machine(machine),
|
: m_machine(machine),
|
||||||
m_name(std::move(name)),
|
m_name(std::move(name)),
|
||||||
m_buffer(length),
|
m_buffer(length),
|
||||||
m_endianness(endian),
|
m_endianness(endian),
|
||||||
m_bitwidth(width * 8),
|
m_bitwidth(width * 8),
|
||||||
|
@ -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