There are two state_t members that have std::size_t type: state_t::m_nested_level and state_t::m_substate_count. On 64-bit platforms they are 64-bit values and occupy 16 bytes of memory.
But the maximum value of m_nested_level is limited by max_deep constant (that is 16 for the last decade and hardly be greater than 256 in the near future). And I'm in doubt that we need something larger that 16-bit value for m_substate_count (even if states for an agent are autogenerated it is hard to imagine a state machine with more than 64K substates for a state).
So if we change the type of m_nested_level to std::uint8_t and type of m_substate_count to std::uint16_t then we can save around of dozen bytes for every state_t instance.
There are two
state_tmembers that havestd::size_ttype:state_t::m_nested_levelandstate_t::m_substate_count. On 64-bit platforms they are 64-bit values and occupy 16 bytes of memory.But the maximum value of
m_nested_levelis limited bymax_deepconstant (that is 16 for the last decade and hardly be greater than 256 in the near future). And I'm in doubt that we need something larger that 16-bit value form_substate_count(even if states for an agent are autogenerated it is hard to imagine a state machine with more than 64K substates for a state).So if we change the type of
m_nested_leveltostd::uint8_tand type ofm_substate_counttostd::uint16_tthen we can save around of dozen bytes for everystate_tinstance.