On 8/2/17 11:18 AM, Nathan Froyd wrote:
In particular, the API of Sequence<> is constrained because it
inherits from FallibleTArray, which *only* exposes fallible
operations.

We should consider just fixing this.

The history here is that FallibleTArray and InfallibleTArray used to bake the allocator into the class type. There was no way to do fallible operations with an InfallibleTArray.

Because Sequence is used for both in parameters and return values in the DOM, and in parameters _must_ be fallible (web content trivially controls the allocation size: "var arr = []; arr.length = 1e9;"), Sequence inherited from FallibleTArray.

But for return values, where _we_ may control the allocation size, it may be reasonable to use infallible array bits if we know the array is small.

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1386711 on maybe changing this.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to