diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-04-01 14:44:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 14:44:47 +0200 |
commit | 916ec2b66e193d58cd16c6a1704f1c49fe589bd0 (patch) | |
tree | 5ed96474b5dc4e3f5af32c75bf65c11a28791f9a /platform/linuxbsd/godot_linuxbsd.cpp | |
parent | 26048c805b5b5912c7ccf8deb06be23c561b0fa0 (diff) | |
parent | ba0317be04168f73dab7a1492485276cfe3d4b2c (diff) | |
download | redot-engine-916ec2b66e193d58cd16c6a1704f1c49fe589bd0.tar.gz |
Merge pull request #59782 from bruvzg/clang_ci_san
Diffstat (limited to 'platform/linuxbsd/godot_linuxbsd.cpp')
-rw-r--r-- | platform/linuxbsd/godot_linuxbsd.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index 7c9f81bd3f..9fe00568fb 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -33,10 +33,20 @@ #include <stdlib.h> #include <unistd.h> +#if defined(SANITIZERS_ENABLED) +#include <sys/resource.h> +#endif + #include "main/main.h" #include "os_linuxbsd.h" int main(int argc, char *argv[]) { +#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 + OS_LinuxBSD os; setlocale(LC_CTYPE, ""); |