Closed
Bug 1850505
Opened 2 years ago
Closed 2 years ago
Avoid -ftrivial-auto-var-init overhead in mozHunspellFileMgrHost::GetLine
Categories
(Firefox Build System :: General, task)
Firefox Build System
General
Tracking
(firefox119 fixed)
RESOLVED
FIXED
119 Branch
| Tracking | Status | |
|---|---|---|
| firefox119 | --- | fixed |
People
(Reporter: sergesanspaille, Assigned: sergesanspaille)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
mozHunspellFileMgrHost::GetLine is defined as followed:
bool mozHunspellFileMgrHost::GetLine(std::string& aResult) {
nsAutoCString line;
auto res = ReadLine(line);
if (res.isErr()) {
return false;
}
aResult.assign(line.BeginReading(), line.Length());
return true;
}
nsAutoCString iteracts poorly with -ftrivial-auto-var-init as it always initializes the internal buffer. In that particular case line is used a temporary container, we could avoid both the initialization and the copy by directly writing to a std::string
| Assignee | ||
Comment 1•2 years ago
|
||
This also positively impacts -ftrivial-auto-var-init as it gets rid of
the nsAutoCString buffer initialization.
Updated•2 years ago
|
Attachment #9350636 -
Attachment description: Bug 1850505 - Avoid extra copy in mozHunspellFileMgrHost::GetLine r=nika → Bug 1850505 - Avoid extra copy in mozHunspellFileMgrHost::GetLine r=emilio
Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cf7a219d11da
Avoid extra copy in mozHunspellFileMgrHost::GetLine r=emilio
Comment 3•2 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 2 years ago
status-firefox119:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•