mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00

This includes a protocol for creating LibGC Heap allocated Swift objects. Pay no attention to the Unmanaged shenanigans, they are all behind the curtain.
15 lines
313 B
C++
15 lines
313 B
C++
/*
|
|
* Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "TestHeap.h"
|
|
#include <LibGC/Heap.h>
|
|
|
|
GC::Heap& test_gc_heap()
|
|
{
|
|
// FIXME: The GC heap should become thread aware!
|
|
thread_local GC::Heap heap(nullptr, [](auto&) {});
|
|
return heap;
|
|
}
|