Open
Bug 1476675
Opened 6 years ago
Updated 2 years ago
-Wlarge-by-value-copy warning on nsTextFrame.cpp
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Core
Layout: Text and Fonts
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox63 | --- | affected |
People
(Reporter: Sylvestre, Unassigned)
References
(Blocks 1 open bug)
Details
nsTextFrame.cpp:1768, Clang (LLVM based), Priority: Normal return value of 'GetFirstFontMetrics' is a large (144 bytes) pass-by-value object; pass it by reference instead ?
Updated•6 years ago
|
Priority: -- → P3
Comment 1•6 years ago
|
||
DXR link: https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/layout/generic/nsTextFrame.cpp#1766-1774 (We don't benefit from return value optimization here because there are two different possible return values.)
Comment 2•6 years ago
|
||
If having two different possible return values is a problem, can we do something like
> gfxFont::Metrics result;
> if (aFontGroup) {
> result = ...;
> }
> return result;
I guess a better way would probably be making the empty one a static, and return a reference to it. (Although I would really be surprised if compiler cannot optimize this function out.)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•