зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9550144327
Коммит
e79384d24c
|
@ -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 {
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче