浏览代码

libobs: Use os_oom() for out of memory crash

This change will make the crash stack clearer when OBS is crashing due
to "out of memory" rather than an explicit bmalloc/brealloc(0) call.
Ryan Foster 2 月之前
父节点
当前提交
01e7b78929
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      libobs/util/bmem.c

+ 2 - 2
libobs/util/bmem.c

@@ -108,7 +108,7 @@ void *bmalloc(size_t size)
 	void *ptr = a_malloc(size);
 
 	if (!ptr) {
-		os_breakpoint();
+		os_oom();
 		bcrash("Out of memory while trying to allocate %lu bytes", (unsigned long)size);
 	}
 
@@ -129,7 +129,7 @@ void *brealloc(void *ptr, size_t size)
 	ptr = a_realloc(ptr, size);
 
 	if (!ptr) {
-		os_breakpoint();
+		os_oom();
 		bcrash("Out of memory while trying to allocate %lu bytes", (unsigned long)size);
 	}