[Webkit-unassigned] [Bug 120112] Typed Arrays have no public facing API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 16 16:50:56 PDT 2015


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

--- Comment #34 from Geoffrey Garen <ggaren at apple.com> ---
> Create a TypedArray:
> JSObjectRef JSObjectMakeTypedArray(JSContextRef ctx, JSTypedArrayType
> arrayType, size_t numElements);

I would say "length" instead of numElements. We don't like to abbreviate in API names, and length is the name in JavaScript.

> Query byte length and element count:
> size_t JSObjectGetTypedArrayByteLength(JSContextRef ctx, JSObjectRef object);
> size_t JSObjectGetTypedArrayNumElements(JSContextRef ctx, JSObjectRef
> object);

Once again, length.

> Obtain a pointer to the array's data (retains the pointer):
> void * JSObjectGetTypedArrayDataPtr(JSContextRef ctx, JSObjectRef object);
> or
> void * JSObjectGetTypedArrayDataPtr(JSContextRef ctx, JSObjectRef object,
> size_t &byteLength);

We say "Create" or "Copy" when we make something that needs a release. Here I would use "Copy" I guess.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151016/f548f3aa/attachment.html>


More information about the webkit-unassigned mailing list