[Webkit-unassigned] [Bug 123058] JSC should have an API for typed arrays

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 19 13:28:08 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=123058





--- Comment #3 from Filip Pizlo <fpizlo at apple.com>  2013-10-19 13:26:53 PST ---
(In reply to comment #2)
> > access individual elements
> 
> That's probably not the most reasonable thing to do in cases that warrant TypedArray use :)
> 
> Personally, I only needed to get bytes from the buffer efficiently. Not sure if there is anything else that can't be done already, but perhaps some syntactic sugar would help? Also, not sure how efficiently one can create a typed array from C code.

I agree we should have such an API.  I think we even have some dup's for this bug - you're not the first to ask for this.

Maybe just the following C API function would be enough:

JSGetTypedArrayBase(JSValueRef) -> returns void* of the first element in the view or the base of the buffer
JSGetTypedArrayByteLength(JSValueRef) -> returns size_t of the number of bytes that the view sees or the byteLength of the buffer.

These will work for any view or buffer and return null/0 for things that aren't typed arrays.

Sound sensible?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list