Closed
Bug 1385538
Opened 8 years ago
Closed 8 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•8 years ago
|
||
Attachment #8891605 -
Flags: review?(masayuki)
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•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Updated•7 years ago
|
Assignee: nobody → ehsan
Blocks: 1720061
You need to log in
before you can comment on or make changes to this bug.
Description
•