diff options
author | DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> | 2022-01-12 17:08:26 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 12:38:26 +0100 |
commit | 62291e9b0e99406ac7f5a95dc329400f9f966825 (patch) | |
tree | 94c0e151828539c52d48a4d3d92a1e0931fe21aa /test_ffi/src | |
parent | 79b698f88b5f8e247df7280ccb52c2a8271a426c (diff) |
feat(ext/ffi): UnsafeFnPointer API (#13340)
Diffstat (limited to 'test_ffi/src')
-rw-r--r-- | test_ffi/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs index 93b274b4b..a04c2c2fd 100644 --- a/test_ffi/src/lib.rs +++ b/test_ffi/src/lib.rs @@ -1,5 +1,6 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +use std::os::raw::c_void; use std::thread::sleep; use std::time::Duration; @@ -101,3 +102,13 @@ pub extern "C" fn nonblocking_buffer(ptr: *const u8, len: usize) { let buf = unsafe { std::slice::from_raw_parts(ptr, len) }; assert_eq!(buf, vec![1, 2, 3, 4, 5, 6, 7, 8]); } + +#[no_mangle] +pub extern "C" fn get_add_u32_ptr() -> *const c_void { + add_u32 as *const c_void +} + +#[no_mangle] +pub extern "C" fn get_sleep_blocking_ptr() -> *const c_void { + sleep_blocking as *const c_void +} |