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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 30 04:35:44 PDT 2015


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

--- Comment #35 from Dominic Szablewski <dominic.szablewski at gmail.com> ---
> We say "Create" or "Copy" when we make something that needs a release. Here
> I would use "Copy" I guess.

Right, but "JSObjectCopyTypedArrayData" would be misleading, in that it implies you get a copy of the data and modifying the data wouldn't do anything on the Typed Array from where it was copied. Maybe it should be named JSDataWrapper instead: i.e. JSObjectCopyTypedArrayDataWrapper()!? I'm not really fan of the verbosity, though.

Two more ideas:

a) JSObjectGetTypedArrayData() returns a JSDataRef unretained. If you want to hold on to it, you have to retain it yourself. I'm not sure if this is feasible - the JSDataRef would have to last as least until the scope of the function that called JSObjectGetTypedArrayData exits.

b) We name the function in a way that doesn't follow the create/copy nomenclature, but clearly states that you own the JSDataRef. I'd propose JSObjectGetRetainedTypedArrayData() or JSObjectGetTypedArrayDataRetain().

If it's possible in a sane matter, I think a) is preferable. Can anybody confirm if this would be feasible? Does JSC implement something like objc's autorelease?

-- 
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/20151030/06e560cb/attachment.html>


More information about the webkit-unassigned mailing list