At present, every time that retro_serialize_size() is called (i.e whenever save states are used), the core determines the save state size by allocating a temporary 5 MB (yes, 5 megabytes...) buffer and writing into this an actual save state. For a core that is focussed solely on performance, this is somewhat absurd... (on memory starved platforms, the temporary buffer allocation may even fail...)
With this PR, the save state size is now calculated independently of regular save state creation. No temporary buffer is required, and there is no need to actually write a save state to memory.
At present, every time that
retro_serialize_size()
is called (i.e whenever save states are used), the core determines the save state size by allocating a temporary 5 MB (yes, 5 megabytes...) buffer and writing into this an actual save state. For a core that is focussed solely on performance, this is somewhat absurd... (on memory starved platforms, the temporary buffer allocation may even fail...)With this PR, the save state size is now calculated independently of regular save state creation. No temporary buffer is required, and there is no need to actually write a save state to memory.