From 530c5abb5da585ac71f9c643c9d6a2171280fe67 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 3 Apr 2022 03:05:53 +1000 Subject: 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. --- src/devices/machine/eepromser.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/devices/machine/eepromser.h') diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h index ac61f8f4aa9..d3d33db19d6 100644 --- a/src/devices/machine/eepromser.h +++ b/src/devices/machine/eepromser.h @@ -198,10 +198,10 @@ protected: void copy_ram_to_eeprom(); void copy_eeprom_to_ram(); void device_start() override; - uint8_t m_ram_length = 0; - uint16_t m_ram_data[16]{}; - uint16_t m_reading = 0; - uint8_t m_store_latch = 0; + uint8_t m_ram_length; + uint16_t m_ram_data[16]; + uint16_t m_reading; + uint8_t m_store_latch; }; -- cgit v1.2.3