diff options
author | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2023-03-01 15:07:00 +0100 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-04-07 14:54:38 +0200 |
commit | 58d24a4cb630a6162d6f7d2a85e41949fdf2ad36 (patch) | |
tree | f03a34d6f2c5f652f83a8a4153d3e80ca98f07c3 /src/libutil/serialise.cc | |
parent | 00bc34430b9e8e687cd3f1681e9f7b5baa7c717e (diff) |
Always disable GC in a coroutine unless the patch is applied
Diffstat (limited to 'src/libutil/serialise.cc')
-rw-r--r-- | src/libutil/serialise.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index 0bdeec0cd..6e53239f5 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -186,18 +186,17 @@ static DefaultStackAllocator defaultAllocatorSingleton; StackAllocator *StackAllocator::defaultAllocator = &defaultAllocatorSingleton; -std::shared_ptr<void> (*create_disable_gc)() = []() -> std::shared_ptr<void> { +std::shared_ptr<void> (*create_coro_gc_hook)() = []() -> std::shared_ptr<void> { return {}; }; /* This class is used for entry and exit hooks on coroutines */ class CoroutineContext { -#if __APPLE__ - /* Disable GC when entering the coroutine on macOS, since it doesn't find the main thread stack in this case. + /* Disable GC when entering the coroutine without the boehm patch, + * since it doesn't find the main thread stack in this case. * std::shared_ptr<void> performs type-erasure, so it will call the right * deleter. */ - const std::shared_ptr<void> disable_gc = create_disable_gc(); -#endif + const std::shared_ptr<void> coro_gc_hook = create_coro_gc_hook(); public: CoroutineContext() {}; ~CoroutineContext() {}; |