Closed Bug 135781 Opened 23 years ago Closed 23 years ago

Use flat strings when constructing string keys

Categories

(Core :: XPCOM, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

There are a few high volume calls which create a string key with a string which outlives the life of the key. In these places, we should ensure that the key is created such that only a clone will copy the string.
Comment on attachment 78403 [details] [diff] [review] fixes a few high volume callers r=dp
Attachment #78403 - Flags: review+
Comment on attachment 78403 [details] [diff] [review] fixes a few high volume callers sr=darin the alternative i guess would be to add a |const nsPromiseFlatString&| member variable to nsStringKey, and call PromiseFlatString from within the constructor. i'm assuming we don't want to bloat nsStringKey by 4-bytes when the |const nsAString&| constructor is not used. makes sense.
Attachment #78403 - Flags: superreview+
Checking in content/base/src/nsNameSpaceManager.cpp; /cvsroot/mozilla/content/base/src/nsNameSpaceManager.cpp,v <-- nsNameSpaceManager.cpp new revision: 3.34; previous revision: 3.33 done Checking in content/events/src/nsEventListenerManager.cpp; /cvsroot/mozilla/content/events/src/nsEventListenerManager.cpp,v <-- nsEventListenerManager.cpp new revision: 1.123; previous revision: 1.122 done Checking in content/xul/document/src/nsControllerCommandManager.cpp; /cvsroot/mozilla/content/xul/document/src/nsControllerCommandManager.cpp,v <-- nsControllerCommandManager.cpp new revision: 1.9; previous revision: 1.8 done Checking in layout/base/src/nsPresState.cpp; /cvsroot/mozilla/layout/base/src/nsPresState.cpp,v <-- nsPresState.cpp new revision: 3.14; previous revision: 3.13 done Checking in xpcom/ds/nsStaticNameTable.cpp; /cvsroot/mozilla/xpcom/ds/nsStaticNameTable.cpp,v <-- nsStaticNameTable.cpp new revision: 1.12; previous revision: 1.11 done Thanks.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: