[whatwg] Endianness of typed arrays

Robert O'Callahan robert at ocallahan.org
Wed Mar 28 19:01:16 PDT 2012


On Thu, Mar 29, 2012 at 2:21 PM, John Tamplin <jat at google.com> wrote:

> a = someFunctionReturningUint16ArrayWhichMightBeLEorBE();
> a[4] = 100;
>
> the call to store into a might need to call Uint16LEArray or
> Uint16BEArray.storeInto under the hood.  If you only ever use one, then the
> JIT'er can just assume that one and inline it.


Can you give a more concrete example? I can't think of a situation where
we'd have a function that toggles between returning little-endian and
returning big-endian buffers.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]



More information about the whatwg mailing list