[Public WebGL] Differing TypedArray#set behavior
Fri Apr 13 07:01:36 PDT 2012
2012/4/13 Stéphan Kochen <[email protected]>
> I was more surprised mixing type was allowed like this, and I suppose it's
> because it also accepts a plain Array. If it weren't for that, everyone
> would simply be calling memmove().
It's not actually like memcpy/memmove, because of the conversion that
happens if the types are different. It's only memmove if the types happen
to be the same.
As an aside, it doesn't seem like the conversion is actually defined, eg.
if you set() an Int16Array onto an Int8Array and some values overflow. I'm
not sure where the conversion is defined even for eg. array8 = 2000
(somewhere in WebIDL, I assume), but set() should use the same rules.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the public_webgl