W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2015

Re: [whatwg] Handling out of memory issues with getImageData/createImageData

From: Anne van Kesteren <annevk@annevk.nl>
Date: Mon, 28 Sep 2015 11:40:31 +0200
Message-ID: <CADnb78icNwHw-8EkvxeLXZWGu1zyaET5bctO3z+JWZ4qZppO3Q@mail.gmail.com>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
Cc: Justin Novosad <junov@google.com>, WHAT Working Group <whatwg@whatwg.org>, Mark Miller <erights@gmail.com>
On Sun, Sep 27, 2015 at 6:14 PM, Allen Wirfs-Brock
<allen@wirfs-brock.com> wrote:
> Actually, that's not completely correct.  Within ES2015, the only way
> explicitly allocate a large, dense area of memory is by creating a large
> ArrayBuffer instance.  All attempts to create such instances eventually
> perform the actions specified by CreateDataBlock [1].  CreateDataBlock
> explicitly says that a RangeError exception is thrown if it is impossible to
> allocated the requested memory.
> I would expect and future ES features that exposed similar allocation
> capabilities to follow that same pattern.
> [1]: http://ecma-international.org/ecma-262/6.0/#sec-createbytedatablock

Thank you Allen. It would then make the most sense to rethrow that
exception for these <canvas> methods (and ImageData constructor). I
filed https://github.com/whatwg/html/issues/197 to track this. If
anyone is interested in working on this let me know. It should be a
relatively straightforward refactoring of the existing descriptions of
these features.

Received on Monday, 28 September 2015 09:40:58 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:35 UTC