Bug 1572207 - Update AutoStableStringChars comment, r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D41421

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Steve Fink 2019-08-09 20:41:12 +00:00
Родитель 9550144327
Коммит e79384d24c
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -35,13 +35,12 @@ MOZ_ALWAYS_INLINE size_t GetStringLength(JSString* s) {
}
/**
* This class provides safe access to a string's chars across a GC. Once
* we allocate strings and chars in the nursery (bug 903519), this class
* will have to make a copy of the string's chars if they are allocated
* in the nursery, so it's best to avoid using this class unless you really
* need it. It's usually more efficient to use the latin1Chars/twoByteChars
* JSString methods and often the code can be rewritten so that only indexes
* instead of char pointers are used in parts of the code that can GC.
* This class provides safe access to a string's chars across a GC. If we ever
* nursery allocate strings' out of line chars, this class will have to make a
* copy, so it's best to avoid using this class unless you really need it. It's
* usually more efficient to use the latin1Chars/twoByteChars JSString methods
* and often the code can be rewritten so that only indexes instead of char
* pointers are used in parts of the code that can GC.
*/
class MOZ_STACK_CLASS JS_FRIEND_API AutoStableStringChars final {
/*