Always disable GC in a coroutine unless the patch is applied

This commit is contained in:
Yorick van Pelt
2023-04-07 14:54:38 +02:00
committed by Théophane Hufschmitt
parent 00bc34430b
commit 58d24a4cb6
4 changed files with 28 additions and 11 deletions
+3 -1
View File
@@ -385,10 +385,12 @@ void initGC()
StackAllocator::defaultAllocator = &boehmGCStackAllocator;
#if NIX_BOEHM_PATCH_VERSION != 1
/* Used to disable GC when entering coroutines on macOS */
create_disable_gc = []() -> std::shared_ptr<void> {
create_coro_gc_hook = []() -> std::shared_ptr<void> {
return std::make_shared<BoehmDisableGC>();
};
#endif
/* Set the initial heap size to something fairly big (25% of
physical RAM, up to a maximum of 384 MiB) so that in most cases