[webkit-changes] [WebKit/WebKit] bad696: [libpas] Fix PGM metadata management across PGM ha...
Dan Hecht
noreply at github.com
Wed Jan 22 02:28:48 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bad6963a608cd1b97bc8a3d341c188a7deee9bf4
https://github.com/WebKit/WebKit/commit/bad6963a608cd1b97bc8a3d341c188a7deee9bf4
Author: Dan Hecht <dan.hecht at apple.com>
Date: 2025-01-22 (Wed, 22 Jan 2025)
Changed paths:
M Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c
M Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.h
M Source/bmalloc/libpas/src/test/PGMTests.cpp
Log Message:
-----------
[libpas] Fix PGM metadata management across PGM hashtable resizes
https://bugs.webkit.org/show_bug.cgi?id=286312
rdar://143331296
Reviewed by Yusuke Suzuki.
If the PGM hashtable is resized, then the underlying entry array
can be reallocated, which invalidates any pointers into the old
entry array. Additionally, even if reallocated in place, the keys
will be rehashed and so they can move to a new entry.
So, the metadata array should not store pointers into the underlying
hashtable storage. Instead, store a copy of the key/value pointers
in the metadata array.
* Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c:
(pas_probabilistic_guard_malloc_deallocate):
(pas_probabilistic_guard_malloc_get_metadata_array):
(pas_probabilistic_guard_malloc_initialize_pgm_as_enabled):
* Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.h:
* Source/bmalloc/libpas/src/test/PGMTests.cpp:
(std::testPGMMetaData):
(std::testPGMMetadataVectorManagement):
(std::testPGMMetadataVectorManagementFewDeallocations):
(std::testPGMMetadataDoubleFreeBehavior):
(std::testPGMMetadataVectorManagementRehash):
(addPGMTests):
Canonical link: https://commits.webkit.org/289233@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list