ladybird/Userland/Libraries/LibJS/Heap/Handle.cpp
Andreas Kling 63cc2650e3 LibJS: Make Handle<T> more user-friendly
Allow *handle, !handle, handle.ptr(), assignment from compatible
pointer types, etc. This is in preparation for using Handles in
more generated code.
2022-09-03 00:36:26 +02:00

24 lines
410 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Heap/Cell.h>
#include <LibJS/Heap/Handle.h>
#include <LibJS/Runtime/VM.h>
namespace JS {
HandleImpl::HandleImpl(Cell* cell)
: m_cell(cell)
{
m_cell->heap().did_create_handle({}, *this);
}
HandleImpl::~HandleImpl()
{
m_cell->heap().did_destroy_handle({}, *this);
}
}