mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/ffi): use anybuffer for op_ffi_buf_copy_into (#21006)
Fixes https://github.com/denoland/deno/issues/21005
This commit is contained in:
parent
daf9756127
commit
5b2d9fb8d4
2 changed files with 3 additions and 1 deletions
|
@ -177,7 +177,7 @@ pub fn op_ffi_buf_copy_into<FP>(
|
|||
state: &mut OpState,
|
||||
src: *mut c_void,
|
||||
#[number] offset: isize,
|
||||
#[buffer] dst: &mut [u8],
|
||||
#[anybuffer] dst: &mut [u8],
|
||||
#[number] len: usize,
|
||||
) -> Result<(), AnyError>
|
||||
where
|
||||
|
|
|
@ -327,6 +327,8 @@ const into2 = new Uint8Array(3);
|
|||
const into2ptr = Deno.UnsafePointer.of(into2);
|
||||
const into2ptrView = new Deno.UnsafePointerView(into2ptr);
|
||||
const into3 = new Uint8Array(3);
|
||||
const into4 = new Uint16Array(3);
|
||||
ptrView.copyInto(into4);
|
||||
ptrView.copyInto(into);
|
||||
console.log([...into]);
|
||||
ptrView.copyInto(into2, 3);
|
||||
|
|
Loading…
Reference in a new issue