ladybird/Libraries/LibGC/HeapRoot.h
Ali Mohammad Pur 76f17f7703 LibGC: Add support for coordinated multi-heap collection
Allow having separate GC heaps and implement coordinated marking between
them; this is useful for keeping wasm and js GC heaps separated with a
clear boundary.
2026-06-19 17:01:47 +02:00

37 lines
717 B
C++

/*
* Copyright (c) 2023-2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/SourceLocation.h>
#include <LibGC/Export.h>
namespace GC {
struct GC_API HeapRoot {
enum class Type {
ConservativeHashMap,
ConservativeHashTable,
ConservativeVector,
CrossHeapMember,
HeapFunctionCapturedPointer,
MustSurviveGC,
RegisterPointer,
Root,
RootHashMap,
RootHashTable,
RootVector,
StackPointer,
VM,
};
Type type;
SourceLocation const* location { nullptr };
Optional<u32> stack_frame_index {};
};
}