Files
bun.sh/src/bun.js/bindings/Strong.cpp
190n ea65a2ad48 Bump WebKit (#17095)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-02-12 22:08:53 -08:00

38 lines
989 B
C++

#include "root.h"
#include <JavaScriptCore/StrongInlines.h>
#include "BunClientData.h"
#include "wtf/DebugHeap.h"
#include "Strong.h"
namespace Bun {
#if ENABLE(MALLOC_BREAKDOWN)
DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(StrongRef);
#endif
}
extern "C" void Bun__StrongRef__delete(Bun::StrongRef* strongRef)
{
delete strongRef;
}
extern "C" Bun::StrongRef* Bun__StrongRef__new(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue encodedValue)
{
return new Bun::StrongRef(globalObject->vm(), JSC::JSValue::decode(encodedValue));
}
extern "C" JSC::EncodedJSValue Bun__StrongRef__get(Bun::StrongRef* strongRef)
{
return JSC::JSValue::encode(strongRef->m_cell.get());
}
extern "C" void Bun__StrongRef__set(Bun::StrongRef* strongRef, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value)
{
strongRef->m_cell.set(globalObject->vm(), JSC::JSValue::decode(value));
}
extern "C" void Bun__StrongRef__clear(Bun::StrongRef* strongRef)
{
strongRef->m_cell.clear();
}