Closed
Bug 1385538
Opened 7 years ago
Closed 7 years ago
EditorBase::BeginPlaceHolderTransaction() is malloc heavy
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
10.08 KB,
patch
|
masayuki
:
review+
|
Details | Diff | Splinter Review |
The malloc as far as I can tell comes from EditorBase::mSelState, which uses UniquePtr. UniquePtr is unfortunately an inefficient smart pointer, it encourages the programmer to dynamically allocate. Here, dynamic allocation isn't needed at all, the object is quite small, what's needed is dynamic lifetime management. That can be done much more efficiently with Maybe, which has inline storage.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8891605 -
Flags: review?(masayuki)
Comment 2•7 years ago
|
||
Comment on attachment 8891605 [details] [diff] [review] Avoid dynamic memory allocation for EditorBase::mSelState Really interesting.
Attachment #8891605 -
Flags: review?(masayuki) → review+
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/30a16b6553d7 Avoid dynamic memory allocation for EditorBase::mSelState; r=masayuki
Comment 4•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/30a16b6553d7
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•6 years ago
|
Assignee: nobody → ehsan
You need to log in
before you can comment on or make changes to this bug.
Description
•