Comment #5 on issue 1927 by [email protected]: ApiCheck in
SetIndexedPropertiesToPixelData with large getImageData arguments
http://code.google.com/p/v8/issues/detail?id=1927
I'm hitting a similar issue with regards to the TypedArrays implementation
for Node. This is sort of a specific situation, because the TypedArray's
spec specifically handles when you cannot allocate enough memory and
specifies what exceptions should be thrown. The problem is that
SetIndexedPropertiesToExternalArrayData like
SetIndexedPropertiesToPixelData does an ApiCheck based on a fixed size
which results in a fatal error if the length is too large.
Is one of the following possible so this can be handled more gracefully:
1) The limit of kMaxLength is somehow exported so the caller can check that
the length is not too large? For now we could hardcode 0x3fffffff in our
own code, but it seems generally a bad idea to try to mirror v8's internal
implementation-specific constants. What if this value changes in the
future? Might it be possible to add a kMaxExternalArrayDataLength static
to the API's Object?
2) Would it otherwise be possible to make this error somehow handle-able,
for example a version of SetIndexedPropertiesToExternalArrayData which
returns an error code (or bool true/false).
3) Is there a way to safely handle the FatalError? This seems like the
worst of the 3 approaches though.
Thanks,
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev