Closed Bug 1850948 Opened 1 year ago Closed 1 year ago

Use lower level implementation for GetMemoryMappings, avoiding a buffer copy in the process

Categories

(Firefox Build System :: General, task)

task

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)

The implementation of GetMemoryMappings uses an internal std::string to read each line, and that buffer is later copied to an nsAutoCStringN in order to perform an strtok-based parsing.

Using a lower level approach avoid the copy on each line processing, and avoid using an nsAutoCStringN that has an extra overhead under -ftrivial-auto-var-init (to initialize the stack buffer).

This is both beneficial for the actual code and an enhancement wrt.
-ftrivial-auto-var-init as it gets rid of a usage of nsAutoCString.

Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d94f12d0e000
Use lower level implementation for GetMemoryMappings, avoiding a buffer copy in the process r=emilio

Issue identified, I submitted a patch in patch 1851154

Depends on: 1851154
Flags: needinfo?(sguelton)
Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8b72bb550f87
Use lower level implementation for GetMemoryMappings, avoiding a buffer copy in the process r=emilio
Attachment #9351030 - Attachment description: Bug 1850948 - Use lower level implementation for GetMemoryMappings, avoiding a buffer copy in the process r=emilio → Bug 1850948 - Use std::string::data() as strtok param in GetMemoryMappings, avoiding a buffer copy in the process r=emilio!
Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f21879d591e
Use std::string::data() as strtok param in GetMemoryMappings, avoiding a buffer copy in the process r=emilio
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Flags: needinfo?(sguelton)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: