1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00

LibGC: Add Swift bindings to the GC heap

This includes a protocol for creating LibGC Heap allocated Swift
objects. Pay no attention to the Unmanaged shenanigans, they are
all behind the curtain.
This commit is contained in:
Andrew Kaster 2024-11-16 14:58:28 -07:00 committed by Andrew Kaster
parent 829391e714
commit fca6fd0b85
Notes: github-actions[bot] 2024-11-19 21:54:12 +00:00
11 changed files with 258 additions and 1 deletions

15
Tests/LibGC/TestHeap.cpp Normal file
View file

@ -0,0 +1,15 @@
/*
* 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;
}