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:
parent
829391e714
commit
fca6fd0b85
Notes:
github-actions[bot]
2024-11-19 21:54:12 +00:00
Author: https://github.com/ADKaster
Commit: fca6fd0b85
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2386
Reviewed-by: https://github.com/alimpfard
11 changed files with 258 additions and 1 deletions
15
Tests/LibGC/TestHeap.cpp
Normal file
15
Tests/LibGC/TestHeap.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue