From a22a5e947390febff9c1772b916a11633496e4f8 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 15 Apr 2020 00:44:09 -0400 Subject: [PATCH] Add MallocNanoZone=1 on macOS for Blender --- hecl/lib/Blender/Connection.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hecl/lib/Blender/Connection.cpp b/hecl/lib/Blender/Connection.cpp index b9a1bcdbf..1f68c38fa 100644 --- a/hecl/lib/Blender/Connection.cpp +++ b/hecl/lib/Blender/Connection.cpp @@ -453,6 +453,11 @@ Connection::Connection(int verbosityLevel) { std::string writefds = fmt::format(FMT_STRING("{}"), m_readpipe[1]); std::string vLevel = fmt::format(FMT_STRING("{}"), verbosityLevel); +#ifdef __APPLE__ + // Undocumented flag that makes Blender not crash ¯\_(ツ)_/¯ + setenv("MallocNanoZone", "1", 1); +#endif + /* Try user-specified blender first */ if (blenderBin) { execlp(blenderBin, blenderBin, "--background", "-P", blenderShellPath.c_str(), "--", readfds.c_str(),