LibGC: Expose deferred state publicly, annotate DeferGC for Swift

While we don't want arbitrary callers deferring GC, we do want
deferral to be available to the Swift. In order for Swift to
understand the RAII nature of DeferGC, we need to mark it as
non-copyable.
This commit is contained in:
Andrew Kaster 2024-11-16 18:45:19 -07:00 committed by Andrew Kaster
parent 32cf4d1e29
commit 726f2cfb11
Notes: github-actions[bot] 2024-11-19 21:54:29 +00:00
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#pragma once #pragma once
#include <AK/Swift.h>
#include <LibGC/Heap.h> #include <LibGC/Heap.h>
namespace GC { namespace GC {
@ -25,6 +26,6 @@ public:
private: private:
Heap& m_heap; Heap& m_heap;
}; } SWIFT_NONCOPYABLE;
} }

View file

@ -73,6 +73,8 @@ public:
void uproot_cell(Cell* cell); void uproot_cell(Cell* cell);
bool is_gc_deferred() const { return m_gc_deferrals > 0; }
private: private:
friend class MarkingVisitor; friend class MarkingVisitor;
friend class GraphConstructorVisitor; friend class GraphConstructorVisitor;