Bug 1255795 - use UniqueTwoByteChars in AtomizeUTF8Chars (r=jandem)
authorLuke Wagner <luke@mozilla.com>
Fri, 11 Mar 2016 08:57:51 -0600
changeset 288287 844d73172246061eab0a612454b4be5aefbcb0df
parent 288286 64c69e804a9196fdabab130735ab45c124abbac4
child 288288 2f5f092a64add23c4bb911179a21352046848406
push id30079
push userryanvm@gmail.com
push dateSat, 12 Mar 2016 20:24:19 +0000
treeherdermozilla-central@d1d47ba19ce9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1255795
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1255795 - use UniqueTwoByteChars in AtomizeUTF8Chars (r=jandem) MozReview-Commit-ID: IjHFnhgyCPH
js/src/jsatom.cpp
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -432,17 +432,17 @@ js::AtomizeUTF8Chars(JSContext* cx, cons
 {
     // This could be optimized to hand the char16_t's directly to the JSAtom
     // instead of making a copy. UTF8CharsToNewTwoByteCharsZ should be
     // refactored to take an ExclusiveContext so that this function could also.
 
     UTF8Chars utf8(utf8Chars, utf8ByteLength);
 
     size_t length;
-    UniquePtr<char16_t> chars(JS::UTF8CharsToNewTwoByteCharsZ(cx, utf8, &length).get());
+    UniqueTwoByteChars chars(JS::UTF8CharsToNewTwoByteCharsZ(cx, utf8, &length).get());
     if (!chars)
         return nullptr;
 
     return AtomizeChars(cx, chars.get(), length);
 }
 
 bool
 js::IndexToIdSlow(ExclusiveContext* cx, uint32_t index, MutableHandleId idp)