Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: adf83e7baf07726e9a3834dde26a2db25bacf0ef
      
https://github.com/WebKit/WebKit/commit/adf83e7baf07726e9a3834dde26a2db25bacf0ef
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    M Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj
    M Source/bmalloc/libpas/src/libpas/pas_internal_config.h
    M Source/bmalloc/libpas/src/libpas/pas_mte.h
    M Source/bmalloc/libpas/src/libpas/pas_try_reallocate.h
    A Source/bmalloc/libpas/src/test/ReallocFastPathTests.cpp
    M Source/bmalloc/libpas/src/test/TestHarness.cpp

  Log Message:
  -----------
  [libpas] Allow in-place realloc for segregated case
https://bugs.webkit.org/show_bug.cgi?id=314380
rdar://176535914

Reviewed by Marcus Plutowski.

This patch makes simple realloc efficient: when the current segregated
heap's slot's object_size >= requested new_size, then just reuse the
current pointer. For MTE, we add PAS_MTE_HANDLE_REALLOCATE_IN_PLACE,
and it does PAS_MTE_PURIFY(stripped-pointer), which just restores the
current pointer's tag as we do not need to change anything.

* Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj:
* Source/bmalloc/libpas/src/libpas/pas_internal_config.h:
* Source/bmalloc/libpas/src/libpas/pas_mte.h:
* Source/bmalloc/libpas/src/libpas/pas_try_reallocate.h:
(pas_try_reallocate_size_fits_in_place):
(pas_try_reallocate_table_segregated_case):
(pas_try_reallocate_table_bitfit_case):
(pas_try_reallocate):
* Source/bmalloc/libpas/src/test/ReallocFastPathTests.cpp: Added.
(std::fillPattern):
(std::checkPattern):
(std::testReallocFastPathGrowWithinSizeClass):
(std::testReallocFastPathShrinkWithinSizeClass):
(std::testReallocFastPathToExactUsableSize):
(std::testReallocGrowBeyondSizeClassCopiesData):
(std::testReallocFastPathSweepAcrossSizes):
(std::testReallocBitfitFastPath):
(std::testReallocExcessiveShrinkForcesCopy):
(std::testReallocLargeDataPreserved):
(std::testReallocFromNullAllocates):
(addReallocFastPathTests):
* Source/bmalloc/libpas/src/test/TestHarness.cpp:
(main):

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



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

Reply via email to