Create a specific "out of memory" variant of os_breakpoint to facilitate troubleshooting and to differentiate an "out of memory" crash from a more generic crash.
@@ -843,6 +843,11 @@ void os_breakpoint()
raise(SIGTRAP);
}
+void os_oom()
+{
+ raise(SIGTRAP);
+}
+
#ifndef __APPLE__
static int physical_cores = 0;
static int logical_cores = 0;
@@ -1257,6 +1257,11 @@ void os_breakpoint(void)
__debugbreak();
+void os_oom(void)
+ __debugbreak();
DWORD num_logical_cores(ULONG_PTR mask)
{
DWORD left_shift = sizeof(ULONG_PTR) * 8 - 1;
@@ -174,6 +174,7 @@ EXPORT bool os_inhibit_sleep_set_active(os_inhibit_t *info, bool active);
EXPORT void os_inhibit_sleep_destroy(os_inhibit_t *info);
EXPORT void os_breakpoint(void);
+EXPORT void os_oom(void);
EXPORT int os_get_physical_cores(void);
EXPORT int os_get_logical_cores(void);