mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00

This is a GC-aware wrapper around AK::HashMap. Entry values are treated as GC roots, much like the GC::RootVector we already had. We also provide GC::OrderedRootHashMap as a convenience.
29 lines
483 B
C++
29 lines
483 B
C++
/*
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/SourceLocation.h>
|
|
|
|
namespace GC {
|
|
|
|
struct HeapRoot {
|
|
enum class Type {
|
|
HeapFunctionCapturedPointer,
|
|
Root,
|
|
RootVector,
|
|
RootHashMap,
|
|
ConservativeVector,
|
|
RegisterPointer,
|
|
StackPointer,
|
|
VM,
|
|
};
|
|
|
|
Type type;
|
|
SourceLocation const* location { nullptr };
|
|
};
|
|
|
|
}
|