mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 21:59:21 +00: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.
16 lines
313 B
C++
16 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;
|
|
}
|