Files
dusklight/libs/JSystem/include
PJB3005 05edbec827 Tag operator new overloads with noexcept
According to the C++ standard, regular operator new must always return a valid pointer, and allocation failure should throw an exception.

The original game did not use exceptions, and instead had its operator new return null on alloc failure.

Clang and GCC seem to be enforcing the standard here, and this is causing crashes on non-Windows platforms like https://sentry.twilitrealm.dev/organizations/twilitrealm/issues/952/, where a JAISe allocation failure (custom pooled operator new overload) crashes the game when it should be handled gracefully. MSVC seems to not make use of this opportunity, meaning the code works as intended.

Tagging the operators with noexcept seems to satisfy GCC, but I admit cppreference is very light on details here.
2026-05-18 02:06:38 +02:00
..