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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 22 11:40:45 PDT 2015


--- Comment #17 from Filip Pizlo <fpizlo at apple.com> ---
(In reply to comment #16)
> How do you create a typed array with a data pointer? Is the input a void*?


> Is the data copied or referenced through some delegate API?

Referenced.  For example the "keep" argument could be interpreted as:

keep=true: we call the system free() on the original void* when we decide to free the buffer.

keep=false: we don't free the original void* buffer when we free the array buffer, and the only way that the client can be sure that we no longer want the backing data is when they destroy the VM.

Having a free callback would be even better.

The use cases for this are things like:

- Native code mmap's something and wants JS to be able to modify the mmap'd memory.
- Native code gets some buffer from some other native API and wants JS to be able to play with that buffer.
- Ad hoc wrapping of native buffers in C->JS calls (in that case keep=false works well enough).  Like, C code gets a piece of text and wants to zero-copy pass it to some JS handler, with the expectation that the handler won't squirrel away that buffer after it returns.

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/20150922/0f03f46c/attachment.html>

More information about the webkit-unassigned mailing list