зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1780025 - Part 6: Remove unused ToCStringBuf::dbuf member. r=jandem
`ToCStringBuf::dbuf` is no longer used after the last part. Differential Revision: https://phabricator.services.mozilla.com/D152071
This commit is contained in:
Родитель
95c4782337
Коммит
da7a9df784
|
@ -751,8 +751,6 @@ static_assert(DTOSTR_STANDARD_BUFFER_SIZE <= JS::MaximumNumberToStringLength,
|
|||
"MaximumNumberToStringLength is large enough to hold the longest "
|
||||
"string produced by a conversion");
|
||||
|
||||
ToCStringBuf::~ToCStringBuf() { js_free(dbuf); }
|
||||
|
||||
MOZ_ALWAYS_INLINE
|
||||
static JSLinearString* LookupDtoaCache(JSContext* cx, double d) {
|
||||
if (Realm* realm = cx->realm()) {
|
||||
|
@ -1777,8 +1775,7 @@ JSAtom* js::NumberToAtom(JSContext* cx, double d) {
|
|||
ToCStringBuf cbuf;
|
||||
char* numStr = FracNumberToCString(&cbuf, d);
|
||||
MOZ_ASSERT(numStr);
|
||||
MOZ_ASSERT(!cbuf.dbuf && numStr >= cbuf.sbuf &&
|
||||
numStr < cbuf.sbuf + cbuf.sbufSize);
|
||||
MOZ_ASSERT(numStr >= cbuf.sbuf && numStr < cbuf.sbuf + cbuf.sbufSize);
|
||||
|
||||
size_t length = strlen(numStr);
|
||||
JSAtom* atom = Atomize(cx, numStr, length);
|
||||
|
@ -1801,8 +1798,7 @@ frontend::TaggedParserAtomIndex js::NumberToParserAtom(
|
|||
ToCStringBuf cbuf;
|
||||
char* numStr = FracNumberToCString(&cbuf, d);
|
||||
MOZ_ASSERT(numStr);
|
||||
MOZ_ASSERT(!cbuf.dbuf && numStr >= cbuf.sbuf &&
|
||||
numStr < cbuf.sbuf + cbuf.sbufSize);
|
||||
MOZ_ASSERT(numStr >= cbuf.sbuf && numStr < cbuf.sbuf + cbuf.sbufSize);
|
||||
|
||||
size_t length = strlen(numStr);
|
||||
return parserAtoms.internAscii(cx, numStr, length);
|
||||
|
@ -1848,7 +1844,7 @@ bool js::NumberValueToStringBuffer(const Value& v, StringBuffer& sb) {
|
|||
cstrlen = strlen(cstr);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!cbuf.dbuf && cstrlen < cbuf.sbufSize);
|
||||
MOZ_ASSERT(cstrlen < cbuf.sbufSize);
|
||||
return sb.append(cstr, cstrlen);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,11 +77,6 @@ extern bool IsInteger(double d);
|
|||
|
||||
extern JSLinearString* IndexToString(JSContext* cx, uint32_t index);
|
||||
|
||||
/*
|
||||
* Usually a small amount of static storage is enough, but sometimes we need
|
||||
* to dynamically allocate much more. This struct encapsulates that.
|
||||
* Dynamically allocated memory will be freed when the object is destroyed.
|
||||
*/
|
||||
struct ToCStringBuf {
|
||||
/*
|
||||
* The longest possible result that would need to fit in sbuf is
|
||||
|
@ -90,9 +85,6 @@ struct ToCStringBuf {
|
|||
*/
|
||||
static const size_t sbufSize = 34;
|
||||
char sbuf[sbufSize];
|
||||
char* dbuf = nullptr;
|
||||
|
||||
~ToCStringBuf();
|
||||
};
|
||||
|
||||
struct Int32ToCStringBuf {
|
||||
|
|
Загрузка…
Ссылка в новой задаче