summaryrefslogtreecommitdiff
path: root/platform/osx/godot_main_osx.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx/godot_main_osx.mm')
-rw-r--r--platform/osx/godot_main_osx.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm
index f3db363151..053a7f4a1d 100644
--- a/platform/osx/godot_main_osx.mm
+++ b/platform/osx/godot_main_osx.mm
@@ -35,12 +35,22 @@
#include <string.h>
#include <unistd.h>
+#if defined(SANITIZERS_ENABLED)
+#include <sys/resource.h>
+#endif
+
int main(int argc, char **argv) {
#if defined(VULKAN_ENABLED)
// MoltenVK - enable full component swizzling support.
setenv("MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE", "1", 1);
#endif
+#if defined(SANITIZERS_ENABLED)
+ // Note: Set stack size to be at least 30 MB (vs 8 MB default) to avoid overflow, address sanitizer can increase stack usage up to 3 times.
+ struct rlimit stack_lim = { 0x1E00000, 0x1E00000 };
+ setrlimit(RLIMIT_STACK, &stack_lim);
+#endif
+
int first_arg = 1;
const char *dbg_arg = "-NSDocumentRevisionsDebugMode";
printf("arguments\n");