/*
 * 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,
        ConservativeVector,
        HeapFunctionCapturedPointer,
        MustSurviveGC,
        RegisterPointer,
        Root,
        RootHashMap,
        RootHashTable,
        RootVector,
        StackPointer,
        VM,
    };

    Type type;
    SourceLocation const* location { nullptr };
    Optional<u32> stack_frame_index {};
};

}
