Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 949ac090a94a20f34427f44601243734e3f86768
      
https://github.com/WebKit/WebKit/commit/949ac090a94a20f34427f44601243734e3f86768
  Author: Dan Hecht <[email protected]>
  Date:   2026-03-11 (Wed, 11 Mar 2026)

  Changed paths:
    M Source/WTF/wtf/IndexMap.h
    M Source/WTF/wtf/IntervalSet.h
    M Tools/TestWebKitAPI/Tests/WTF/IntervalSet.cpp

  Log Message:
  -----------
  [JSC] IntervalSet should be non-copyable but still moveable
https://bugs.webkit.org/show_bug.cgi?id=309720
rdar://172317692

Reviewed by Yusuke Suzuki.

IntervalSet should be non-copyable since the nodes need to have
a single owner. There was one place that was using copy construction,
IndexMap, but it was safe because it would only copy empty (initial value)
IntervalSets.

But now, IndexMap doesn't have access to a copy constructor and so it
needs a constructor that uses default construction. But this constructor
is not equivalent for POD since Vector::grow() does not zero-fill while
the original constructor does. So the new constructor is restricted to
avoid POD.

Test: Tools/TestWebKitAPI/Tests/WTF/IntervalSet.cpp
* Source/WTF/wtf/IndexMap.h:
(WTF::IndexMap::requires):
* Source/WTF/wtf/IntervalSet.h:
(WTF::IntervalSet::IntervalSet):
(WTF::IntervalSet::operator=):
* Tools/TestWebKitAPI/Tests/WTF/IntervalSet.cpp:
(TestWebKitAPI::TEST(WTF_IntervalSet, MoveConstructor)):
(TestWebKitAPI::TEST(WTF_IntervalSet, MoveAssignment)):
(TestWebKitAPI::TEST(WTF_IntervalSet, MoveConstructorEmpty)):
(TestWebKitAPI::TEST(WTF_IntervalSet, MoveAssignmentEmpty)):
(TestWebKitAPI::TEST(WTF_IntervalSet, MoveConstructorSourceDestructed)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to