Commit graph

21 commits

Author SHA1 Message Date
刘皓
00c688309b
Fix edge case in pointer unswizzling algorithm for libretro save state serialization
If there are two Ruby objects, A and B, that are both no longer used
(i.e. they're able to be freed by the Ruby garbage collector), and A
references B, then it's possible for the Ruby garbage collector to free
B but not also free A in the same garbage collection cycle.

The pointer unswizzling algorithm currently crashes when the garbage
collector does this because the object A will still be in
`sb()->objects` but B will not be, and so save state serialization will
still try to serialize A. When the pointer unswizzling algorithm tries
to serialize all the other objects A references and cannot find the
referenced object B, the program crashes.
2025-07-02 13:32:06 -04:00
刘皓
afb0748ffa
Use a priority deque to allocate object keys/WASI file descriptors 2025-06-03 10:59:30 -04:00
刘皓
175a210532
Implement deserializing libretro save states of the opposite endianness 2025-06-02 17:39:30 -04:00
刘皓
3c244cc7ea
Refactor libretro save state serialization to not require extra objects 2025-05-31 19:06:57 -04:00
刘皓
bb4dd64d8d
Add some safety checks to libretro save state deserialization 2025-05-31 16:34:15 -04:00
刘皓
6f6efb4ef0
Fix fonts and autotiles/bitmap arrays being leaked when serializing libretro save states 2025-05-31 12:26:26 -04:00
刘皓
2ee1b61670
Fix some more bugs in libretro save state serialization/deserialization 2025-05-31 10:47:47 -04:00
刘皓
56c711f1c1
Move some serialization-related code from binding-util to sandbox-serial-util 2025-05-29 21:06:29 -04:00
刘皓
6f472fb732
Handle disposal when deserializing save states in libretro builds 2025-05-28 15:32:43 -04:00
刘皓
1f5d90822c
Remove designated initializers
Apparently these are not valid until C++20.
2025-05-27 21:28:29 -04:00
刘皓
8ca753d85d
Continue implementing save state deserialization in libretro builds 2025-05-27 16:59:41 -04:00
刘皓
290ce15875
Fix typos in binding-sandbox/sandbox-serial-util.h 2025-05-26 21:29:10 -04:00
刘皓
c8dc6792b2
Improve pointer deserialization utilities in libretro builds 2025-05-25 14:58:59 -04:00
刘皓
cf11a0ed14
Also change void *& to const void *& in sandbox_serialize_member_declaration 2025-05-25 12:39:04 -04:00
刘皓
58e3ec2035
Change second argument of sandbox_deserialize from void *& to const void *& 2025-05-25 09:33:12 -04:00
刘皓
7558f3fbcb
Add utilities for deserializing save states in libretro builds 2025-05-24 22:16:26 -04:00
刘皓
bc0bd7fe65
Make some small improvements to save state serialization in libretro builds 2025-05-24 19:19:57 -04:00
刘皓
057b6dc95d
Serialize the path of the currently playing movie in libretro builds 2025-05-23 12:06:03 -04:00
刘皓
01ff2ec75a
Apply some small fixes to save state serialization in libretro builds 2025-05-22 19:20:28 -04:00
刘皓
941e0e1cef
Fix linker error in binding-sandbox/sandbox-serial-util.h on some platforms 2025-05-22 13:35:58 -04:00
刘皓
2896ec5abd
Implement save state serialization for C++ objects owned by the bindings in libretro builds 2025-05-22 12:49:01 -04:00