1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibJS: Add Handle<T>, a strong C++ handle for keeping GC objects alive

This is pretty heavy and unoptimized, but it will do the trick for now.
Basically, Heap now has a HashTable<HandleImpl*> and you can call
JS::make_handle(T*) to construct a Handle<T> that guarantees that the
pointee will always survive GC until the Handle<T> is destroyed.
This commit is contained in:
Andreas Kling 2020-03-18 20:03:17 +01:00
parent e265058768
commit a119b61782
6 changed files with 103 additions and 0 deletions

View file

@ -33,6 +33,7 @@ class Argument;
class Cell;
class Expression;
class Function;
class HandleImpl;
class Heap;
class HeapBlock;
class Interpreter;
@ -42,4 +43,7 @@ class ScopeNode;
class Value;
enum class DeclarationType;
template<class T>
class Handle;
}