Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 55d19429ed493b3ce3f46a819530a3612e0c087c
https://github.com/WebKit/WebKit/commit/55d19429ed493b3ce3f46a819530a3612e0c087c
Author: Ben Cohen <[email protected]>
Date: 2026-10-06 (Tue, 06 Oct 2026)
Changed paths:
M Source/WebCore/style/values/primitives/StylePrimitiveData.cpp
Log Message:
-----------
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
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications