[quickjs-devel] Using typed arrays in C

  • From: Saúl Ibarra Corretgé <s@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Thu, 19 Sep 2019 00:51:35 +0200

Hey there,

I was wondering if there is a way to work with the underlying
ArrayBuffer from a typed array which is passed as a function argument.

We have JS_GetArrayBuffer, but that only works with ArrayBuffer
instances. I'd like to access the buffer used in a Uint8Array, at the
right offset and length.

How would one go about doing this, given there is no way (that I can
see) to check the parameter type?


Cheers,

-- 
Saúl

Other related posts: