Closed Bug 1037686 Opened 12 years ago Closed 12 years ago

Remove js_strdup, replace with UniquePtr-returning method

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(3 files)

There are sufficiently few users we should just do this.
I *think* the current ownership model lets us make this change basically trivially, unless I'm missing some quirkiness.
Attachment #8454724 - Flags: review?(jimb)
Attachment #8454726 - Flags: review?(jimb)
Comment on attachment 8454722 [details] [diff] [review] Change a bunch of users to use a new DuplicateString overload Review of attachment 8454722 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me.
Attachment #8454722 - Flags: review?(jimb) → review+
Comment on attachment 8454724 [details] [diff] [review] Convert ScriptSource::{filename,introducerFilename}_ to UniquePtr, make !introducerFilename_ formally imply filename_ Review of attachment 8454724 [details] [diff] [review]: ----------------------------------------------------------------- I can't see anything wrong with this. ::: js/src/jsscript.cpp @@ +1765,4 @@ > info->uncompressed += mallocSizeOf(uncompressedChars()); > else if (dataType == DataCompressed) > info->compressed += mallocSizeOf(compressedData()); > + info->misc += mallocSizeOf(this) + mallocSizeOf(filename_.get()); Ignoring introducerFilename_ here is an existing bug, but since you've made introducerFilename_ and filename_ never share storage, you might consider addressing it now and including mallocSizeOf(introducerFilename_.get()) in the count.
Attachment #8454724 - Flags: review?(jimb) → review+
Comment on attachment 8454726 [details] [diff] [review] Remove js_strdup now that no one uses it Review of attachment 8454726 [details] [diff] [review]: ----------------------------------------------------------------- What could go wrong?
Attachment #8454726 - Flags: review?(jimb) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: