1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Always disable GC in a coroutine unless the patch is applied

This commit is contained in:
Yorick van Pelt 2023-03-01 15:07:00 +01:00
parent 4c73eab923
commit 176005749c
No known key found for this signature in database
GPG key ID: A36E70F9DC014A15
4 changed files with 28 additions and 11 deletions

View file

@ -366,10 +366,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