Branch: refs/heads/webkitglib/2.54
Home: https://github.com/WebKit/WebKit
Commit: 934d1b1a92a626cee61a8878bc0ef77faa5e4637
https://github.com/WebKit/WebKit/commit/934d1b1a92a626cee61a8878bc0ef77faa5e4637
Author: Ben Cohen <[email protected]>
Date: 2026-10-13 (Tue, 13 Oct 2026)
Changed paths:
M Source/WebCore/style/values/primitives/StylePrimitiveData.cpp
Log Message:
-----------
Cherry-pick 322846@main (55d19429ed49).
https://bugs.webkit.org/show_bug.cgi?id=325845
Style::PrimitiveData leaks every Calculation::Value and CalcSizeValue it is
moved from
https://bugs.webkit.org/show_bug.cgi?id=325845
rdar://188856865
Reviewed by Sam Weinig.
PrimitiveData(uint8_t, UnevaluatedCalculationBase&&) and
PrimitiveData(uint8_t, UnevaluatedCalcSize&&)
pass value.leakRef(), which already transfers ownership of one reference, to
ValueHandleMap::insert(Ref<ValueType>&&). The argument binds through the
implicit Ref(T&)
constructor, which takes a second reference that is never released, so the
value is never
destroyed after its last handle goes away. Every computed calc() length
takes this path, through
PrimitiveNumeric(Calc&&).
Adopt the reference instead. In a harness that creates and destroys 5,285
calc lengths per pass
against a Release WebCore, resident size grew about 72 bytes per value
before this change and is
flat after it.
No new tests since there is no behavior change.
Canonical link: https://commits.webkit.org/322846@main
Adapted for 2.54: only the UnevaluatedCalculationBase&& overload exists
here (the UnevaluatedCalcSize&& one was added in 321191@main), and the
map is still Calculation::ValueMap instead of ValueHandleMap.
Canonical link: https://commits.webkit.org/317695.434@webkitglib/2.54
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications