Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0ebb7ad84892cd1df014a5c33ff363b39a8250d2
      
https://github.com/WebKit/WebKit/commit/0ebb7ad84892cd1df014a5c33ff363b39a8250d2
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2025-07-16 (Wed, 16 Jul 2025)

  Changed paths:
    M Source/ThirdParty/ANGLE/src/common/PoolAlloc.cpp
    M Source/ThirdParty/ANGLE/src/common/PoolAlloc.h
    M Source/ThirdParty/ANGLE/src/common/PoolAlloc_unittest.cpp
    M Source/ThirdParty/ANGLE/src/common/span.h
    M 
Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/AllocatorHelperPool.cpp
    M Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/AllocatorHelperPool.h

  Log Message:
  -----------
  ANGLE: PoolAllocator is more complex than necessary
https://bugs.webkit.org/show_bug.cgi?id=295398
rdar://154944202

Reviewed by Dan Glastonbury and Mike Wyrzykowski.

Simplify PoolAllocator implementation by removing verbose debug code

Hard-code the page size for the page allocations to the de-facto size
that is used.

Changes the alignment algorithm:

Before, the current pointer would be at an arbitrary address. Allocation
would first align the current pointer and then current pointer
would be bumped the exact size amount.

After, current pointer is always aligned at mAlignment. The page is
allocated aligned to mAlignment. Each allocation size is rounded up to
alignment and current pointer is bumped by that amount. This means that
the initial allocation is now made with AlignedAlloc instead of new[].

For now, stores the guard blocks out of line in a std::vector to
simplify the implementation.

Fixes UBs where objects of type PageHeader, Allocation pointed to
by internal implementation were not neccessarily aligned.

* Source/ThirdParty/ANGLE/src/common/PoolAlloc.cpp:
(angle::PoolAllocator::PoolAllocator):
(angle::PoolAllocator::lock):
(angle::PoolAllocator::unlock):
(angle::PoolAllocator::PageHeader::PageHeader):
(angle::PoolAllocator::adjustAllocationExtent const):
(angle::PoolAllocator::addGuard):
(angle::PoolAllocator::~PoolAllocator):
(angle::PoolAllocator::reset):
(angle::PoolAllocator::allocateNewPage):
(angle::PoolAllocator::allocate):
(angle::Allocation::Allocation): Deleted.
(angle::Allocation::AlignedHeaderSize): Deleted.
(angle::Allocation::AllocationSize): Deleted.
(angle::Allocation::GetDataPointer): Deleted.
(angle::Allocation::checkAlloc const): Deleted.
(angle::Allocation::preGuard const): Deleted.
(angle::Allocation::data const): Deleted.
(angle::Allocation::postGuard const): Deleted.
(angle::Allocation::HeaderSize): Deleted.
(angle::PageHeader::PageHeader): Deleted.
(angle::Allocation::checkGuardBlock const): Deleted.
(angle::PoolAllocator::initializeAllocation): Deleted.
(angle::Allocation::checkAllocList const): Deleted.
* Source/ThirdParty/ANGLE/src/common/PoolAlloc.h:
(angle::PoolAllocator::adjustAllocationExtent const):
(angle::PoolAllocator::addGuard):
(angle::PoolAllocator::bump):
(angle::PoolAllocator::allocate):
(angle::PoolAllocator::fastAllocate): Deleted.
* Source/ThirdParty/ANGLE/src/common/PoolAlloc_unittest.cpp:
(angle::PoolAllocatorTest::GetAlignment):
(angle::TEST_P):
(angle::TEST(PoolAllocatorTest, Interface)): Deleted.
* Source/ThirdParty/ANGLE/src/common/span.h:
(angle::Span::subspan const):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/AllocatorHelperPool.cpp:
(rx::vk::DedicatedCommandBlockPool::allocateNewBlock):
* Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/AllocatorHelperPool.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to