When expecting a positive integer...

Kevin Gadd kevin.gadd at gmail.com
Tue Apr 9 07:01:38 PDT 2013

I previously had a discussion with someone about Typed Array sizes in
particular - at present it seems like no existing implementation of Typed
Arrays will allow you to allocate one larger than 2GB, regardless of the
actual numeric types being used. But when I did a quick scan of the Safari,
Chrome and Spidermonkey implementations, I found some uses of ToInt32 and
equivalent operations instead of ToUInt32 - which would imply being limited
to a maximum index that fits into a positive 32-bit integer.

Being able to allocate a 4GB typed array on a 64-bit machine, if not one
even bigger than that, would certainly be welcome.

On Tue, Apr 9, 2013 at 6:58 AM, Brendan Eich <brendan at mozilla.com> wrote:

> Dmitry Lomov wrote:
>> If people agree this is generally a thing to be avoided, I am happy to
>> collect a systematic list of these issues and suggest fixes - but maybe I
>> am missing something and that has some deep motivation?
> No, please collect and file at bugs.ecmascript.org -- these are indeed
> errors in the draft. We need to throw on negative length. We must *not*
> spec clamping negative indexes to 0 at runtime. Other deviations from
> Khronos and implementation need to be considered carefully in light of
> performance and safety (which are not always at odds).
> Thanks to you and Domenic for flagging.
> /be
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130409/b17c88c4/attachment-0001.html>

More information about the es-discuss mailing list