diff options
author | Nathan Woods <npwoods@mess.org> | 2011-11-06 11:06:58 +0000 |
---|---|---|
committer | Nathan Woods <npwoods@mess.org> | 2011-11-06 11:06:58 +0000 |
commit | cdd0600db472ec86297d7df34e145069624f3455 (patch) | |
tree | b558a8d95b11a95ef7af0a526383988c4122142d /src | |
parent | 36932b4c6ca54ce1510ff2ee8c1701c589d75822 (diff) |
Added hot/cold attributes. Made the MAME executable 1% smaller by using the
cold attribute on setup functions
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/addrmap.h | 2 | ||||
-rw-r--r-- | src/emu/device.h | 16 | ||||
-rw-r--r-- | src/emu/ioport.h | 2 | ||||
-rw-r--r-- | src/emu/mconfig.h | 8 | ||||
-rw-r--r-- | src/osd/osdcomm.h | 4 |
5 files changed, 18 insertions, 14 deletions
diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h index 846bbba0066..fb82b2aa769 100644 --- a/src/emu/addrmap.h +++ b/src/emu/addrmap.h @@ -470,7 +470,7 @@ public: #define ADDRESS_MAP_NAME(_name) construct_address_map_##_name #define ADDRESS_MAP_START(_name, _space, _bits) \ -void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device) \ +ATTR_COLD void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device) \ { \ typedef read##_bits##_delegate read_delegate; \ typedef write##_bits##_delegate write_delegate; \ diff --git a/src/emu/device.h b/src/emu/device.h index b5faf4a9a87..bdfea18335e 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -273,9 +273,9 @@ public: // state saving interfaces template<typename _ItemType> - void save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != NULL); m_save->save_item(name(), tag(), index, value, valname); } + void ATTR_COLD save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != NULL); m_save->save_item(name(), tag(), index, value, valname); } template<typename _ItemType> - void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != NULL); m_save->save_pointer(name(), tag(), index, value, valname, count); } + void ATTR_COLD save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != NULL); m_save->save_pointer(name(), tag(), index, value, valname, count); } // debugging device_debug *debug() const { return m_debug; } @@ -297,12 +297,12 @@ protected: virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; virtual void device_config_complete(); - virtual bool device_validity_check(emu_options &options, const game_driver &driver) const; - virtual void device_start() = 0; - virtual void device_stop(); - virtual void device_reset(); - virtual void device_pre_save(); - virtual void device_post_load(); + virtual bool device_validity_check(emu_options &options, const game_driver &driver) const ATTR_COLD; + virtual void device_start() ATTR_COLD = 0; + virtual void device_stop() ATTR_COLD; + virtual void device_reset() ATTR_COLD; + virtual void device_pre_save() ATTR_COLD; + virtual void device_post_load() ATTR_COLD; virtual void device_clock_changed(); virtual void device_debug_setup(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 2f1688c85ee..25ca0aa17cf 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -954,7 +954,7 @@ typedef void (*ioport_constructor)(device_t &owner, ioport_list &portlist, astri /* start of table */ #define INPUT_PORTS_START(_name) \ -void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf) \ +ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, astring &errorbuf) \ { \ astring fulltag; \ input_setting_config *cursetting = NULL; \ diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index e9f6a5192e0..77bd6528381 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -175,7 +175,7 @@ private: #define MACHINE_CONFIG_NAME(_name) construct_machine_config_##_name #define MACHINE_CONFIG_START(_name, _class) \ -device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ +ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ { \ device_t *device = NULL; \ const char *tag; \ @@ -185,7 +185,7 @@ device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \ #define MACHINE_CONFIG_FRAGMENT(_name) \ -device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ +ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ { \ device_t *device = NULL; \ const char *tag; \ @@ -195,7 +195,7 @@ device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ assert(owner != NULL); \ #define MACHINE_CONFIG_DERIVED(_name, _base) \ -device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ +ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ { \ device_t *device = NULL; \ const char *tag; \ @@ -206,7 +206,7 @@ device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ assert(owner != NULL); \ #define MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) \ -device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ +ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \ { \ device_t *device = NULL; \ const char *tag; \ diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index d6e4d219e7a..4b9fcaf0160 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -68,6 +68,8 @@ #define ATTR_CONST __attribute__((const)) #define ATTR_FORCE_INLINE __attribute__((always_inline)) #define ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) +#define ATTR_HOT __attribute__((hot)) +#define ATTR_COLD __attribute__((cold)) #define UNEXPECTED(exp) __builtin_expect(!!(exp), 0) #define EXPECTED(exp) __builtin_expect(!!(exp), 1) #define RESTRICT __restrict__ @@ -81,6 +83,8 @@ #define ATTR_CONST #define ATTR_FORCE_INLINE #define ATTR_NONNULL(...) +#define ATTR_HOT +#define ATTR_COLD #define UNEXPECTED(exp) (exp) #define EXPECTED(exp) (exp) #define RESTRICT |