mkxp-z/binding-sandbox
刘皓 031245491f
Keep track of all C++ objects allocated by bindings in libretro builds
This commit adds `sb()->create_object()`, `sb()->get_object()`,
`sb()->check_object_type()` and `sb()->destroy_object()` in libretro
builds to keep track of all C++ objects allocated by the bindings in
libretro builds. This has some benefits:

* Any C++ objects allocated by the bindings that are still alive when
  the game terminates can now be deallocated instead of being leaked
  like before.
* We now keep track of the types of all objects allocated by the
  bindings, so we will be able to detect when the bindings attempt to
  access objects of mismatching type.
* Keeping track of all allocated objects is required to implement
  libretro save states.
* Objects are now kept track of using numeric keys whose sizes are the
  same on every platform rather than pointers, which helps with making
  save states portable across platforms.
2025-05-19 14:44:44 -04:00
..
audio-binding.cpp Handle game shutdown properly in libretro builds 2025-05-18 10:03:08 -04:00
audio-binding.h Handle game shutdown properly in libretro builds 2025-05-18 10:03:08 -04:00
binding-base.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
binding-base.h Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
binding-sandbox.cpp Handle game shutdown properly in libretro builds 2025-05-18 10:03:08 -04:00
binding-sandbox.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
binding-util.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
binding-util.h Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
bitmap-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
bitmap-binding.h Implement growing VM memory in libretro builds 2025-05-09 22:49:13 -04:00
disposable-binding.h Add more helper functions for bindings in libretro builds 2025-05-01 11:18:02 -04:00
etc-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
etc-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
flashable-binding.h Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
font-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
font-binding.h Implement growing VM memory in libretro builds 2025-05-09 22:49:13 -04:00
graphics-binding.cpp Handle game shutdown properly in libretro builds 2025-05-18 10:03:08 -04:00
graphics-binding.h Handle game shutdown properly in libretro builds 2025-05-18 10:03:08 -04:00
input-binding.cpp Fix handling of big-endian platforms in libretro builds 2025-05-10 18:55:14 -04:00
input-binding.h Implement growing VM memory in libretro builds 2025-05-09 22:49:13 -04:00
meson.build Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
module_rpg.cpp Reconcile the standalone and libretro build systems 2025-04-09 23:52:12 -04:00
plane-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
plane-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
sandbox.cpp Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
sandbox.h Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
sceneelement-binding.h Add more helper functions for bindings in libretro builds 2025-05-01 11:18:02 -04:00
serializable-binding.h Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
sprite-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
sprite-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
table-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
table-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
tilemap-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
tilemap-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
tilemapvx-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
tilemapvx-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
viewport-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
viewport-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
viewportelement-binding.h Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
wasi.cpp Capitalize /Dist, /Game, /Save and /System in libretro builds for consistency 2025-05-13 17:53:59 -04:00
wasi.h Apply big-endian fixes to binding-sandbox/wasi.cpp as well 2025-05-12 12:39:08 -04:00
wasm-rt.cpp Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
wasm-rt.h Implement growing VM memory in libretro builds 2025-05-09 22:49:13 -04:00
wasm-types.h Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
window-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
window-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00
windowvx-binding.cpp Keep track of all C++ objects allocated by bindings in libretro builds 2025-05-19 14:44:44 -04:00
windowvx-binding.h Refactor binding-sandbox header files into .cpp files 2025-04-30 22:31:13 -04:00