diff options
author | Vas Crabb <vas@vastheman.com> | 2022-04-03 03:05:53 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2022-04-03 03:07:28 +1000 |
commit | 530c5abb5da585ac71f9c643c9d6a2171280fe67 (patch) | |
tree | 978357b74d3506db174181e74bb3f4d81c421f64 /src/devices/bus/nes/kaiser.h | |
parent | c4f9ff9790382c1c5b99a2ffbb2a14e04d4c7cea (diff) |
Revert initialisation of device members in headers.
This is problematic in several ways:
* Initialising things at construction that aren't needed until after
start slows down -romident, -validate, -listxml, etc. Slot cards can
be a particular drain on -listxml and -validate as they're
instantiated for every compatible slot. It's more pronounced for
array members, too.
* Splitting member initialisation between declaration in headers and
constructors in source files means you have to look at two places to
check for the initial value, and you always need to check the
constructor even if an initialiser is present in the header because
the constructor initaliser list takes precedence. (This isn't as much
of an issue for driver classes because the constructor is most often
inlined at declaration, so it isn't far from the member declarations.)
* Initialisers in headers for frequently-used devices increases the
frequency of recompiling dependent devices/drivers as they're exposed
to any changes in initialisers.
* Initialisers in frequently-used headers increase build times because
there's more for the compiler to parse/cache. (This affects
makedep.py as well for single-driver builds, but that's a single
pass.) It's not a lot individually, but it adds up given the size of
MAME, which keeps increasing. We've already had one contributor
banned from GitHub actions for resource usage, we don't want to waste
compiler time unnecessarily.
Diffstat (limited to 'src/devices/bus/nes/kaiser.h')
-rw-r--r-- | src/devices/bus/nes/kaiser.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/bus/nes/kaiser.h b/src/devices/bus/nes/kaiser.h index 31bef65627b..5962a77dd13 100644 --- a/src/devices/bus/nes/kaiser.h +++ b/src/devices/bus/nes/kaiser.h @@ -23,7 +23,7 @@ protected: virtual void device_start() override; private: - u8 m_latch = 0; + u8 m_latch; }; @@ -63,7 +63,7 @@ protected: virtual void device_start() override; private: - uint8_t m_latch = 0; + uint8_t m_latch; }; @@ -88,11 +88,11 @@ protected: virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - u8 m_reg[8]{}; + u8 m_reg[8]; private: void prg_update(); - u8 m_latch = 0; + u8 m_latch; u16 m_irq_count, m_irq_count_latch; int m_irq_enable; @@ -136,7 +136,7 @@ protected: virtual void device_start() override; private: - u8 m_latch = 0; + u8 m_latch; const u8 m_a15_flip; }; @@ -171,7 +171,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; private: - uint8_t m_latch = 0; + uint8_t m_latch; uint16_t m_irq_count; uint8_t m_irq_status; @@ -218,7 +218,7 @@ protected: virtual void device_start() override; private: - u8 m_latch = 0; + u8 m_latch; }; @@ -327,7 +327,7 @@ protected: private: void update_prg(); - uint8_t m_latch = 0; + uint8_t m_latch; uint8_t m_reg[8]; }; |