Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7dcd9cb1553ae285bbac270e2ddfd93c55988595
      
https://github.com/WebKit/WebKit/commit/7dcd9cb1553ae285bbac270e2ddfd93c55988595
  Author: Mark Lam <[email protected]>
  Date:   2023-12-03 (Sun, 03 Dec 2023)

  Changed paths:
    A JSTests/stress/typedarray-sort-out-of-memory.js
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h
    M Source/WTF/wtf/Vector.h

  Log Message:
  -----------
  Enhance genericTypedArrayViewProtoFuncSortImpl to also handle an OutOfMemory 
case.
https://bugs.webkit.org/show_bug.cgi?id=265743
rdar://119042412

Reviewed by Yusuke Suzuki.

1. Add a Vector::tryGrow implementation.
2. Make JSGenericTypedArrayView<Adaptor>::sort return a SortResult.
3. Make clients of sort also check for the OutOfMemory error case, and throw an
   OutOfMemoryError.

* JSTests/stress/typedarray-sort-out-of-memory.js: Added.
(catch):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::sort):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSortImpl):
* Source/WTF/wtf/Vector.h:
(WTF::Vector::grow):
(WTF::Vector::tryGrow):
(WTF::Malloc>::growImpl):
(WTF::Malloc>::grow): Deleted.

Canonical link: https://commits.webkit.org/271457@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to