From 3d6fa64f19e74924813ece5e5fbd53023342bac8 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Mon, 20 Jun 2022 14:06:04 +0300 Subject: feat(ext/ffi): Callbacks (#14663) This commit adds support for unstable FFI callbacks. A callback is registered using the `Deno.UnsafeCallback` API. The backing memory for the callback can be disposed of using `Deno.UnsafeCallback#close`. It is not safe to pass the callback after calling close. Callbacks from other than the isolate thread are not supported. Co-authored-by: Divy Srivastava Co-authored-by: Bert Belder --- runtime/js/90_deno_ns.js | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/js/90_deno_ns.js') diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index ea5303149..f21b261db 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -139,6 +139,7 @@ createHttpClient: __bootstrap.fetch.createHttpClient, http: __bootstrap.http, dlopen: __bootstrap.ffi.dlopen, + UnsafeCallback: __bootstrap.ffi.UnsafeCallback, UnsafePointer: __bootstrap.ffi.UnsafePointer, UnsafePointerView: __bootstrap.ffi.UnsafePointerView, UnsafeFnPointer: __bootstrap.ffi.UnsafeFnPointer, -- cgit v1.2.3