Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ca5e69e829722666caa292025996d15c3fa077aa
      
https://github.com/WebKit/WebKit/commit/ca5e69e829722666caa292025996d15c3fa077aa
  Author: Dan Hecht <[email protected]>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj
    A Source/bmalloc/libpas/src/test/AllocationZeroingTests.cpp
    M Source/bmalloc/libpas/src/test/TestHarness.cpp
    M Source/bmalloc/libpas/src/test/xctest/LibpasTests.mm

  Log Message:
  -----------
  [libpas] Add AllocationZeroingTests: functional zeroed-reuse tests
https://bugs.webkit.org/show_bug.cgi?id=319599
rdar://182424502

Reviewed by Marcus Plutowski.

Add a functional test file that drives the real bmalloc public zeroing API
end to end and verifies the zeroed allocation path always returns
fully-zeroed memory, including when a freed region is reused.

Each case does zeroed-alloc / verify-zero / dirty / free /
reallocate-same-size / verify-zero, run across several axes:

- Size: representative points for every regime of the zeroed-malloc path --
    small- and medium-segregated, medium- and marge-bitfit, and the large
    heap's memset and virtual-memory zeroing paths. Sizes are derived from
    the config's page-size and threshold constants, so the run keeps hitting
    the interesting boundaries if a config changes.
- Alignment: the natural minimum plus a range of explicit alignments.
- Variant: the untagged and tagged zeroed entry points.
- Reuse: both immediate free-list reuse and forced decommit/recommit (a
    synchronous scavenge between free and reuse).

Registers the suite in TestHarness.cpp, the Xcode project, and the xctest
suite list.

Test: Source/bmalloc/libpas/src/test/AllocationZeroingTests.cpp

* Source/bmalloc/libpas/libpas.xcodeproj/project.pbxproj:
* Source/bmalloc/libpas/src/test/AllocationZeroingTests.cpp: Added.
(std::dirtyBuffer):
(std::firstNonZeroByte):
(std::variantName):
(std::alignmentApiName):
(std::allocateZeroed):
(std::deallocateVariant):
(std::reportParameters):
(std::checkIsZeroed):
(std::checkIsAligned):
(std::zeroingReuse):
(std::runZeroingReuse):
(std::segregatedRegimeSizes):
(std::bitfitRegimeSizes):
(std::largeMemsetRegimeSizes):
(std::largeVirtualMemoryRegimeSizes):
(std::testZeroingReuseSegregatedSizes):
(std::testZeroingReuseBitfitSizes):
(std::testZeroingReuseLargeMemsetSizes):
(std::testZeroingReuseLargeVirtualMemorySizes):
(std::testZeroingReuseWithScavengeSegregatedSizes):
(std::testZeroingReuseWithScavengeBitfitSizes):
(std::testZeroingReuseWithScavengeLargeMemsetSizes):
(std::testZeroingReuseWithScavengeLargeVirtualMemorySizes):
(addAllocationZeroingTests):
* Source/bmalloc/libpas/src/test/TestHarness.cpp:
(main):
* Source/bmalloc/libpas/src/test/xctest/LibpasTests.mm:

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



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

Reply via email to