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 buffer and writing into this an actual save state. Moreover, it then fails to report the actual size correctly due to a bug in the memory stream wrapper code - which means save states are always 5 MB in size. This represents a terrible inefficiency.
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 - and save states now have the correct size (~830 kb)
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 buffer and writing into this an actual save state. Moreover, it then fails to report the actual size correctly due to a bug in the memory stream wrapper code - which means save states are always 5 MB in size. This represents a terrible inefficiency.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 - and save states now have the correct size (~830 kb)